r/purebasic • u/beltzebuh • Mar 02 '24
Any suggestions on how to avoid rounding prob?
valD("3.50") = 3.499999999999999776...
3
Upvotes
r/purebasic • u/beltzebuh • Mar 02 '24
valD("3.50") = 3.499999999999999776...
1
u/ricardo_sdl Mar 14 '24
Which version of PureBasic compiler are you using? On my tests with PureBasic 6.02 the conversion went fine showing 3.5 in the debug window:
And 3.5 is exactly represented with double numbers: https://float.exposed/0x400c000000000000 so this should run fine, unless you doing some calculations?