sigildocs

(scheme inexact)

(scheme inexact) - R7RS Inexact Library

Mathematical functions for inexact (floating-point) numbers including trigonometric, exponential, and logarithmic operations.

See: R7RS Small §6.2.6

Exports

finite?procedure

Test if a number is finite.

Returns #t if the number is neither infinite nor NaN.

(finite? 42)      ; => #t
(finite? 3.14)    ; => #t
(finite? +inf.0)  ; => #f
(finite? +nan.0)  ; => #f
infinite?procedure

Test if a number is infinite.

Returns #t if the number is positive or negative infinity.

(infinite? +inf.0)  ; => #t
(infinite? -inf.0)  ; => #t
(infinite? 42)      ; => #f
(infinite? +nan.0)  ; => #f
nan?procedure

Test if a number is NaN (not a number).

Returns #t if the number is the special NaN value, which results from undefined operations like (/ 0.0 0.0).

(nan? +nan.0)      ; => #t
(nan? (/ 0.0 0.0)) ; => #t
(nan? 42)          ; => #f
(nan? +inf.0)      ; => #f