This site is a static rendering of the Trac instance that was used by R7RS-WG1 for its work on R7RS-small (PDF), which was ratified in 2013. For more information, see Home. For a version of this page that may be more recent, see Infinity in WG2's repo for R7RS-large.

Infinity

cowan
2012-05-08 12:21:46
1history
source

These are the R6RS examples involving +inf.0 and -inf.0 (already accounted for verbally in the "Implementation extensions" section of R7RS):

(complex? +inf.0) => #t ; infinities are real but not rational (real? -inf.0) => #t (rational? -inf.0) => #f (integer? -inf.0) => #f (inexact? +inf.0) => #t ; infinities are inexact (= +inf.0 +inf.0) => #t ; infinities are signed (= -inf.0 +inf.0) => #f (= -inf.0 -inf.0) => #t (positive? +inf.0) => #t (negative? -inf.0) => #t (abs -inf.0) => +inf.0 (finite? +inf.0) => #f ; infinities are infinite (infinite? +inf.0) => #t ; infinities are maximal (max +inf.0 x) => +inf.0 where x is real (min -inf.0 x) => -inf.0 where x is real (< -inf.0 x +inf.0)) => #t where x is real and finite (> +inf.0 x -inf.0)) => #t where x is real and finite (floor +inf.0) => +inf.0 (ceiling -inf.0) => -inf.0 ; infinities are sticky (+ +inf.0 x) => +inf.0 where x is real and finite (+ -inf.0 x) => -inf.0 where x is real and finite (+ +inf.0 +inf.0) => +inf.0 (+ +inf.0 -inf.0) => +nan.0 ; sum of oppositely signed infinities is NaN (- +inf.0 +inf.0) => +nan.0 (* 5 +inf.0) => +inf.0 ; infinities are sticky (* -5 +inf.0) => -inf.0 (* +inf.0 +inf.0) => +inf.0 (* +inf.0 -inf.0) => -inf.0 (/ 0.0) => +inf.0 ; infinities are reciprocals of zero (/ 1.0 0) => +inf.0 (/ -1 0.0) => -inf.0 (/ +inf.0) => 0.0 (/ -inf.0) => -0.0 if distinct from 0.0 (rationalize +inf.0 3) => +inf.0 (rationalize +inf.0 +inf.0) => +nan.0 (rationalize 3 +inf.0) => 0.0 (exp +inf.0) => +inf.0 (exp -inf.0) => 0.0 (log +inf.0) => +inf.0 (log 0.0) => -inf.0 (log -inf.0) => +inf.0+3.141592653589793i ; approximately (atan -inf.0) => -1.5707963267948965 ; approximately (atan +inf.0) => 1.5707963267948965 ; approximately (sqrt +inf.0) => +inf.0 (sqrt -inf.0) => +inf.0i (angle +inf.0) => 0.0 (angle -inf.0) => 3.141592653589793 (magnitude (make-rectangular x y)) => +inf.0 where x or y or both are infinite