Summary
CR: Division by inexact zero results in infinity (or nan) as per IEEE 754
Metadata
- Id: c560c2f6737f6e66d3afb7f0d832628cc2ba369b
- Trac id: 672
- Type: defect
- Reporter: sjamaan
- Owner:
- Cc:
- Status: closed
- Component: core libraries
- Estimated difficulty:
- Resolution: wontfix
- Priority: major
- Milestone: 4.9.0
- Version: 4.7.x
- Changetime: 2012-09-24 21:47:48 UTC
- Created: 2011-08-24 21:15:28 UTC
- Keywords: numbers, flonums, IEEE 754
Description
Current behaviour in Chicken core AND the numbers egg is not IEEE754-compliant (afaik):
(/ 1.0 0.0) => error: division by zero (/ -1.0 0.0) => error: division by zero (/ 0.0 0.0) => error: division by zero
Should this be changed to return +inf.0, -inf.0 and +nan.0, respectively?
Changes and comments
[2011-08-25 17:27:43 UTC] zbigniew wrote:
My only argument against doing this in core is that large exacts may be coerced to inexact without warning, which would change the result of the computation from error to inf/nan. (We also know Felix is opposed to changing the behavior of the / operator in core (fp/ already returns the correct result)).
However, the numbers egg does not exhibit this problem, so in my opinion, you should change numbers to return IEEE 754 compliant results.
[2011-09-07 21:59:59 UTC] sjamaan wrote:
division by inexact zero return infinity/nan in core?; Yes; No)]
[2011-09-15 12:53:10 UTC] sjamaan changed status from new to closed
[2011-09-15 12:53:10 UTC] sjamaan set resolution to wontfix
[2012-09-24 21:47:48 UTC] felix changed milestone from 4.8.0 to 4.9.0
[2012-09-24 21:47:48 UTC] felix wrote:
Milestone 4.8.0 deleted