2012-07-15 04:27:46

WG1 - Core

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.

389

alexshinn

major

cowan

duplicate

closed

Ban mixed-exactness complex numbers

2012-05-07 07:23:28

defect

cowan

comment

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`.

2

1342301266256301

389

2012-07-15 04:27:46

cowan

resolution

duplicate

1342301266256301

389

2012-07-15 04:27:46

cowan

status

closed

new

1342301266256301

389

2012-07-15 04:27:46

cowan

comment

1

1336350565389909

389

2012-05-07 07:29:25

cowan

description

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.

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 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.

1336350565389909

389

2012-05-07 07:29:25