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.

Ticket 389: Ban mixed-exactness complex numbers

2012-07-15 04:27:46
WG1 - Core
alexshinn
major
cowan
duplicate
source
closed
2012-05-07 07:23:28
defect

No Scheme standard prescribes how complex numbers interoperate with exactness. Different implementations provide inexact complex numbers only, exact and inexact complex numbers, and mixed-exactness complex numbers (see ComplexRepresentations for who provides what).

Mixed-exactness complex numbers, however, are problematic. As a whole they must be treated as inexact, and R7RS-draft already says so. However, in implementations where 1.0+2i, 1+2.0i, and 1.0+2.0i are distinct in the sense of eqv?, they are all = and have the same exactness. This means that their behavior is different under arithmetic operations that treat the real and imaginary parts separately, which seems counter-intuitive. The Common Lisp Hyperspec does not permit mixed-exactness complex numbers; CLISP provides them as an extension.

The five implementations in the test suite that provide mixed-exactness complex numbers are MIT, Gambit, Chibi, Mosh, STklos.

descriptionNo Scheme standard prescribes how complex numbers interoperate with exactness. Different implementations provide inexact complex numbers only, exact and inexact complex numbers, and mixed-exactness complex numbers (see ComplexImplementations for who provides what). Mixed-exactness complex numbers, however, are problematic. As a whole they must be treated as inexact, and R7RS-draft already says so. However, in implementations where 1.0+2i, 1+2.0i, and 1.0+2.0i are distinct in the sense of `eqv?`, they are all = and have the same exactness. This means that their behavior is different under arithmetic operations that treat the real and imaginary parts separately, which seems counter-intuitive. The Common Lisp Hyperspec does not permit mixed-exactness complex numbers; CLISP provides them as an extension. The five implementations in the test suite that provide mixed-exactness complex numbers are MIT, Gambit, Chibi, Mosh, STklos.No Scheme standard prescribes how complex numbers interoperate with exactness. Different implementations provide inexact complex numbers only, exact and inexact complex numbers, and mixed-exactness complex numbers (see ComplexRepresentations for who provides what). Mixed-exactness complex numbers, however, are problematic. As a whole they must be treated as inexact, and R7RS-draft already says so. However, in implementations where 1.0+2i, 1+2.0i, and 1.0+2.0i are distinct in the sense of `eqv?`, they are all = and have the same exactness. This means that their behavior is different under arithmetic operations that treat the real and imaginary parts separately, which seems counter-intuitive. The Common Lisp Hyperspec does not permit mixed-exactness complex numbers; CLISP provides them as an extension. The five implementations in the test suite that provide mixed-exactness complex numbers are MIT, Gambit, Chibi, Mosh, STklos.
resolutionduplicate
statusnewclosed

Subsumed under #460, because by R5RS rules (eqv? 1.0+2i 1.0+2.0i) returns #t, because the argument are = and have the same exactness, namely inexact), but by R6RS rules it returns #f, since the arguments return different values to the standard arithmetic procedure imag-part.