Float Output - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Float Output (
/showthread.php?tid=522676)
Float Output -
yoran765 - 28.06.2014
Ello,
Just a question...
How come?
Re: Float Output -
Konstantinos - 28.06.2014
Floats are not perfect. You can check if the value is something specific (if you are aware of what values going wrong) and after subtracting with 0.1, add 0.000001 to the result.
Re: Float Output -
yoran765 - 28.06.2014
Wierd thing is that if I subtract 0.1 from 15.1 it'll become 15.0.
Is there anyway to do this without floats? Strings maybe?
Re: Float Output -
Pottus - 28.06.2014
That loss of precision is too small to have any major effect rule of thumb when working with floats use >= and <=
Re: Float Output -
yoran765 - 28.06.2014
Quote:
Originally Posted by [uL]Pottus
That loss of precision is too small to have any major effect rule of thumb when working with floats use >= and <=
|
I seriously never thought of that... Thank you lol