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.

Source for wiki MaxInfNan version 2

author

cowan

comment


    

ipnr

98.14.173.81

name

MaxInfNan

readonly

0

text

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 (or 4-3 if Guile, which does not fully implement R6RS, is included), and that all the Java ones prefer `+nan.0`, as Java does.

time

2012-06-21 00:04:43

version

2