3.2.1 Number Types
Returns #t if v
is a number, #f otherwise.
Examples: | ||||||
|
Examples: | ||||||||||
|
Examples: | ||||||
|
Examples: | ||||||||||||
|
(exact-integer? v) → boolean? v : any/c
Examples: | ||||
|
(exact-nonnegative-integer? v) → boolean? v : any/c
Examples: | ||||
|
(exact-positive-integer? v) → boolean? v : any/c
Examples: | ||||
|
(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.
(double-flonum? v) → boolean? v : any/c
Identical to flonum?.
(single-flonum? v) → boolean? v : any/c
Return #t if v is a single-precision floating-point
number, #f otherwise.
Examples: | ||||
|
Examples: | ||||||
|
Examples: | ||||||
|
Examples: | ||||||
|
Examples: | ||||||
|
Returns #t if z
is an exact number, #f otherwise.
Examples: | ||||
|
Returns #t if z
is an inexact number, #f otherwise.
Examples: | ||||
|
(inexact->exact z) → exact? z : number?
Coerces z to an
exact number. If z is already exact, it is returned. If z
is +inf.0, -inf.0, or +nan.0, then the
exn:fail:contract exception is raised.
Examples: | ||||
|
(exact->inexact z) → inexact? z : number?
Coerces z to an
inexact number. If z is already inexact, it is returned.
Examples: | ||||
|
(real->single-flonum x) → single-flonum? x : real?
Coerces x
to a single-precision floating-point number. If x is already
a single-precision floating-point number, it is returned.
(real->double-flonum x) → flonum? x : real?
Coerces x
to a double-precision floating-point number. If x is already
a double-precision floating-point number, it is returned.