4.3.1 Number Types
> (integer? 1) #t
> (integer? 2.3) #f
> (integer? 4.0) #t
> (integer? +inf.0) #f
> (integer? 2+3i) #f
> (integer? "hello") #f
procedure
(exact-integer? v) → boolean?
v : any/c
> (exact-integer? 1) #t
> (exact-integer? 4.0) #f
procedure
v : any/c
> (exact-nonnegative-integer? 0) #t
> (exact-nonnegative-integer? -1) #f
procedure
v : any/c
> (exact-positive-integer? 1) #t
> (exact-positive-integer? 0) #f
procedure
(inexact-real? v) → boolean?
v : any/c
Note: the result of this function is platform-dependent, so using it in syntax transformers can lead to platform-dependent bytecode files. See also fixnum-for-every-system?.
procedure
(double-flonum? v) → boolean?
v : any/c
procedure
(single-flonum? v) → boolean?
v : any/c
procedure
Currently, single-flonum-available? produces #t when (system-type 'vm) produces 'racket, and single-flonum-available? produces #f otherwise.
If the result is #f, then single-flonum? also produces #f for all arguments.
Added in version 7.3.0.5 of package base.
> (even? 10.0) #t
> (even? 11) #f
> (even? +inf.0) even?: contract violation
expected: integer?
given: +inf.0
> (odd? 10.0) #f
> (odd? 11) #t
> (odd? +inf.0) odd?: contract violation
expected: integer?
given: +inf.0
procedure
(inexact->exact z) → exact?
z : number?
> (inexact->exact 1) 1
> (inexact->exact 1.0) 1
procedure
(exact->inexact z) → inexact?
z : number?
> (exact->inexact 1) 1.0
> (exact->inexact 1.0) 1.0
procedure
x : real?
procedure
(real->double-flonum x) → flonum?
x : real?