-
Notifications
You must be signed in to change notification settings - Fork 63
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
FloatEqualThreshhold broken ? #51
Comments
Ok so i looked up where you guys found the implementation for this function and the original author thinks that it's ok that pure 0 isn't equal to something very very close to zero.
Personally I can't agree with that but I don't want to change the lib if you guys think so. |
UPDATE: ok i digged in deeper and realised that epsilon passed to FloatEqualThreshold isnt the max difference between a and b. This should be mentioned and it should be clear how it scales with numbers. |
Also, the declaration in java is
while ours is
Any reason we do |
We should add a function that takes a target float, a "biggest difference" and returns a epsilon |
@hydroflame I haven't read everything here -- but you may be looking for relative equality, e.g. https://github.com/azul3d/lmath/blob/master/math.go#L12-L22 (http://realtimecollisiondetection.net/blog/?p=89) |
Yeah we still need a clearer documentation |
I'm first going to ask you guys to confirm this before marking this as a bug. But shouldn't this
FloatEqualThreshold(8.742278e-08, 0, 1e-4)
return true ? (because it doesn't)The text was updated successfully, but these errors were encountered: