Skip to content
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

Is this a floating point problem? #30

Open
stacksmith opened this issue Jun 12, 2023 · 1 comment
Open

Is this a floating point problem? #30

stacksmith opened this issue Jun 12, 2023 · 1 comment

Comments

@stacksmith
Copy link

A simple loop locks up:

(= i 0)
(while (< i 19000000)
   (= i (+ i 1)))

Is there a preferred way to count?

@ooichu
Copy link

ooichu commented Jun 12, 2023

Yes, this is a problem related to floating point numbers. After number 16777216 for 4-byte float the accuracy drops, and incrementation has no effect.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants