-
Notifications
You must be signed in to change notification settings - Fork 986
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
(/ 0 4.0) is 0.0, not 0 #400
Comments
(/ 0 4.0) evaluates to 0.0. I'm not sure this is a bug, but I was
expecting 0, like (* 0 0.25). Is there a good reason for the current
behavior?
R6RS has the following example:
|
Thanks. After thinking about it some more, I guess the argument is that 3.5, as an inexact number, could conceivably be so inaccurate that it's actually zero, in which case the quotient is undefined, not zero. |
Actually, it doesn't make sense for (/ 0 x), where x is a floating-point number, to be anything other than 0, since a floating-point number is never true 0 (just very small on either side of 0) and never truly infinite (just possibly very large, i.e., the reciprocal of a very small number). We got this wrong in R6RS. We should correct it for the version of / exported by (chezscheme) and leave the broken behavior for (rnrs). |
|
(/ 0 4.0) evaluates to 0.0. I'm not sure this is a bug, but I was expecting 0, like (* 0 0.25). Is there a good reason for the current behavior?
The text was updated successfully, but these errors were encountered: