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

Negative­Sqrt

cowan
2015-07-06 00:36:50
4history
source

This is a test of (sqrt -1) to determine various issues: does the value become inexact, and if we don't have complex numbers, do we get an error or a NaN?

Returns exact +i: Racket, MIT, Gambit, Chibi, Chez, Vicare, Ypsilon, Mosh, IronScheme, STklos, Spark, Owl Lisp, Sagittarius

Return inexact 0.0+1.0i: Gauche, Chicken (with the numbers egg), Scheme48/scsh, Guile, Kawa, SISC, SCM, Larceny, KSi, S7, UMB, Foment

Returns +nan.0: Chicken (without the numbers egg), NexJ, JScheme, RScheme, BDC, VX, Inlab, Picrin

Signals an error: Bigloo, Ikarus, Scheme 9, XLisp, Rep, Schemik, Elk, SXM, Sizzle, Dfsch

sqrt is undefined: SigScheme, Shoe, TinyScheme, Llava, Oaklisp, FemtoLisp

Dream hangs.

A further test of (sqrt -1.0) produces 0.0+1.0i, +nan.0, or an error consistently with the above.