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

Precision for Float32 too high #44

Open
ffreyer opened this issue Dec 14, 2021 · 0 comments
Open

Precision for Float32 too high #44

ffreyer opened this issue Dec 14, 2021 · 0 comments

Comments

@ffreyer
Copy link

ffreyer commented Dec 14, 2021

With Float32 inputs a single bit of difference can cause all digits to be written to a string:

Showoff.showoff(Float32[0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.90000004], :plain)
# ["0.30000001", "0.40000001", "0.50000000", "0.60000002", "0.69999999", "0.80000001", "0.90000004"]
nextfloat(0.9f0)
# 0.90000004f0
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

1 participant