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 NegativeZero version 1

author

cowan

comment


    

ipnr

98.14.173.81

name

NegativeZero

readonly

0

text

These are the R6RS examples involving -0.0 (already accounted for verbally in the "Implementation extensions" section of R7RS):

{{{
(zero? -0.0)  => #t                ; -0.0 is a Scheme zero

(+ 0.0 0.0)   => 0.0               ; Sum is -0.0 only if all arguments are -0.0
(+ 0.0 -0.0)  => 0.0
(+ -0.0 0.0)  => 0.0
(+ -0.0 -0.0) => -0.0

(- 0.0)       => -0.0             ; Negation flips the sign of zero
(- -0.0)      => 0.0

(- 0.0 -0.0)  => 0.0              ; Negate all arguments but the last and then add
(- -0.0 0.0)  => -0.0
(- 0.0 0.0)   => 0.0
(- -0.0 -0.0) => 0.0

(log -1.0+0.0i) => 0.0+3.141592653589793i ; approximately
(log -1.0-0.0i) => 0.0-3.141592653589793i ; approximately

(angle -1.0+0.0i) => 3.141592653589793    ; approximately
(angle -1.0-0.0i) => -3.141592653589793   ; approximately
}}}

time

2012-05-08 08:38:17

version

1