33.8025-33=0.802502 over
33.8125-33=0.8125 correct
33.8225-33=0.822498 under
33.8325-33=0.8325 correct
33.8425-33=0.842499 under
33.8525-33=0.852501 over
Description
Details
- Legacy ID
- 1700025985
- Severity
- None
- Resolution
- Reopened
- Reproducibility
- Always
- Category
- Scripting
Just do any basic subtraction against a floating point.
This shouldn't be an issue in a game engine in 2014.
Event Timeline
I would really like you to read http://floating-point-gui.de/ and then understand that FP arithmetic will not ever return precise decimal results. That being said, I would really like to know the precision used in the game engine.
The Int calculation is somewhat puzzling though. That should not happen.
Looks like the game is using single precision: http://codepad.org/hcwPbKPf (I think you'll find a few game engines using single precision in 2014)
Also looks like (as with JavaScript) there is strictly no integer type, just operations on floats: http://codepad.org/YK8G2YV0
I am, of course, not implying that double precision would give exact answers, just the appearance of meeting expectations in these simple cases.
zx64: correct on both accounts.
If this behavior breaks some specific mission or mechanic please report it as a separate issue.