[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Chicken-janitors] #1587: imag-part should return 0 instead of 0.0 on a
From: |
Chicken Trac |
Subject: |
[Chicken-janitors] #1587: imag-part should return 0 instead of 0.0 on a flonum |
Date: |
Thu, 21 Feb 2019 02:38:01 -0000 |
#1587: imag-part should return 0 instead of 0.0 on a flonum
----------------------------+--------------------------------
Reporter: johnwcowan | Owner:
Type: defect | Status: new
Priority: minor | Milestone: 5.1
Component: core libraries | Version: 5.0.0
Keywords: | Estimated difficulty: trivial
----------------------------+--------------------------------
Currently if you call `imag-part` on a flonum (inexact real number) you
get `0.0`. This is consistent with the fact that Chicken requires the
real and imaginary components of a non-real number to be either both exact
or both inexact. However, it means that there is no way to distinguish
between a numeric value computed by real/flonum operations only, whose
imaginary part really is exactly zero, and a number computed by complex
operations whose imaginary part is not mathematically zero but is simply
too close to zero to be distinguished by IEEE floats.
If such "pseudo-real" numbers return `0.0` to `imag-part`, and actual real
numbers return `0`, it will be straightforward to discriminate. Even if
we don't know the mathematically exact value of such a real number on the
real line, we do know exactly where it falls on the imaginary line, namely
at zero.
--
Ticket URL: <https://bugs.call-cc.org/ticket/1587>
CHICKEN Scheme <https://www.call-cc.org/>
CHICKEN Scheme is a compiler for the Scheme programming language.
- [Chicken-janitors] #1587: imag-part should return 0 instead of 0.0 on a flonum,
Chicken Trac <=