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 MaxInfNan in WG2's repo for R7RS-large.

Max­Inf­Nan

cowan
2012-06-09 08:58:08
1history
source

R6RS requires that (max +inf.0 x) for any real x return +inf.0; it is silent about (max x +inf.0), but I'd think that was entailed. I tested (max +inf.0 +nan.0) against the test suite.

Racket, Gauche, MIT, Chicken (with and without the numbers egg), Scheme48, Guile, Ypsilon, Mosh, IronScheme, STklos, Elk, VX return +inf.0.

Gambit, Bigloo, Kawa, SISC, Chibi, Chez, Vicare, Larceny, NexJ, UMB, Spark, Femtolisp return +nan.0.

My other Schemes throw errors, either because they don't like inexact numbers, they don't like division by 0.0, or they produce cockeyed values of (/ 1.0 0.0) and/or (/ 0.0 0.0).

Note that the six R6RS implementations are split 3-3, and that all the Java ones prefer +nan.0.