[racket] No, no, silly rabbit, Single-Flonum is for kids

From: John Clements (clements at brinckerhoff.org)
Date: Sun Sep 23 01:40:33 EDT 2012

I'm trying to convert a list of Reals into a list of Floats, and the natural choice is (map exact->inexact l).  Unfortunately, it appears that exact->inexact produces Inexact-Reals, not flonums. Taking a look at the type expansions, I see that the difference is that Inexact-Real includes *single-*flonums. I'm guessing--and this is just a guess--that the only situation where exact->inexact will produce single-flonums is when it's *given* a single-flonum. 

If I'm right, then it's safe for me to stick in a predicate that detects and fails on results that aren't flonums. If I'm wrong, then exact->inexact might spit out a single-flonum when given, say, 19. That would be a problem. Is my conjecture correct?

I would suggest some kind of change to TR here, but honestly I can see that fixing this would probably be a big pain.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 4800 bytes
Desc: not available
URL: <http://lists.racket-lang.org/users/archive/attachments/20120922/3890ff6f/attachment.p7s>

Posted on the users mailing list.