Opened 13 years ago

Closed 13 years ago

Last modified 12 years ago

#672 closed defect (wontfix)

CR: Division by inexact zero results in infinity (or nan) as per IEEE 754

Reported by: sjamaan Owned by:
Priority: major Milestone: 4.9.0
Component: core libraries Version: 4.7.x
Keywords: numbers, flonums, IEEE 754 Cc:
Estimated difficulty:


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?

Change History (4)

comment:1 Changed 13 years ago by Jim Ursetto

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.

comment:3 Changed 13 years ago by sjamaan

Resolution: wontfix
Status: newclosed

comment:4 Changed 12 years ago by felix winkelmann


Milestone 4.8.0 deleted

Note: See TracTickets for help on using tickets.