Java and Float comparisons #245
mittelmark
started this conversation in
General
Replies: 2 comments 6 replies
|
What do you mean? |
1 reply
|
I don't understand what you mean by "Java seems to have trouble with comparing floats". Can you show a reproducer? Is there an error message? |
5 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Java seems to have trouble with comparing floats, so instead of doing things like:
f1 > f2
in Java we should do:
Float.compare(f1,f2)>0
Should this again go in a native block? Or are there any other workarounds?
like f1-f2>0.00001 ... ?
9 Languages ... Welcome to Babylon.
All reactions