String to Float, and float comparisons
Original Reporter info from Mantis: Robert Kosek
-
Reporter name: Robert K
Original Reporter info from Mantis: Robert Kosek
- Reporter name: Robert K
Description:
This is a particularly nasty bug! For full notes and source online see this page:
http://www.pascalgamedevelopment.com/viewtopic.php?p=39687#39687
Comparison between a hardcoded float, 0.9 for example, and a double or real value of the same value show as false.
Conversion from string to float only works on non-single values, and the single values have strange deviations that don't seem to change. I have run it countless times now and 0.9 is always the same 0.8999999762 value.
Console output:
Float Debugger
Value = 0.9
Custom converter results: true
Default converter results:
Single -> false(0.8999999762)
Double -> false(0.9)
Real -> false(0.9)
Extended -> true (0.9)
Mantis conversion info:
- Mantis ID: 10024
- Version: 2.2.0