darknotfear Posted July 15, 2022 Posted July 15, 2022 DebugLog("" + 0.0001 as float) ;0.000100 DebugLog("" + (0.000000 < 0.0001)) ;False DebugLog("" + Math.abs(0.00000)) ;0.000000 DebugLog("" + Math.abs(0.00000 - 0.00000)) ;0.000000 DebugLog("" + (Math.abs(0.00000 - 0.00000) < 0.0001)) ;False DebugLog("" + (Math.abs(0.00000 - 0.00000) < 0.001)) ;TRUE Â The log output is at the right after the comma. But why? What I did wrong or is there anything to do with float precision? Â
DeWired Posted July 15, 2022 Posted July 15, 2022 Huh. First thought - "when is string conversion done - before or after comparison?.." So, if you put comparison inside an If and then put into log just predefined string based on true or false - does it also glitch?
darknotfear Posted July 17, 2022 Author Posted July 17, 2022 On 7/15/2022 at 9:25 PM, DeWired said: Huh. First thought - "when is string conversion done - before or after comparison?.." So, if you put comparison inside an If and then put into log just predefined string based on true or false - does it also glitch? Yes it still does. I changed float comparion into abs(a-b) < 0.001 now.
Recommended Posts
Archived
This topic is now archived and is closed to further replies.