imag-part of a real and non-complex number should be exact zero
Peter McGoron via Chicken-users <[email protected]> Mon, 27 Jul 2026 16:16:56 -0400
| Newsgroups | gmane.lisp.scheme.chicken |
|---|---|
| Message-ID | <[email protected]> |
For example, `(imag-part 1.0)` should evaluate to `0`, not `0.0`. Rationale: 1. We should have `(eqv? z (make-rectangular (real-part z) (imag-part z)))`. 2. The number `1.0` is exactly on the real number line, not approximately on the real number line. This behavior is important for some numeric code near the branch cuts of functions. 3. `(eqv? 1.0 1.0+0.0i)` is #f, so the numbers should be non-`eqv?` in one of their parts. I do not believe this is required by the R5RS/R7RS, but it is allowed and is useful. -- Peter McGoron