[racket] TR: predicate for a Float ?

From: Sam Tobin-Hochstadt (samth at ccs.neu.edu)
Date: Thu Jan 5 20:30:43 EST 2012

On Fri, Jan 6, 2012 at 1:00 AM, John Clements <clements at brinckerhoff.org> wrote:
>
> Examining the difference between Inexact-Real and Float yields this:
>
>> (:type Float)
> (U Float-Positive-Zero Float-Negative-Zero Float-Nan Positive-Float Negative-Float)
>> (:type Inexact-Real)
> (U Float-Positive-Zero Float-Negative-Zero Float-Nan Positive-Float Negative-Float Single-Flonum-Positive-Zero Single-Flonum-Negative-Zero Single-Flonum-Nan Positive-Single-Flonum Negative-Single-Flonum)
>
> ...which actually made me laugh out loud.  Is there a predicate I can use instead of 'inexact-real?' that checks whether a number belongs to the type Float?

You can use `flonum?' as the predicate for `Float', which excludes
single-precision floats.  But why do you want to exclude them?
-- 
sam th
samth at ccs.neu.edu



Posted on the users mailing list.