SA-MP Forums Archive
[mysql] float are not accurate? +REP - 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: [mysql] float are not accurate? +REP (/showthread.php?tid=635280)



[mysql] float are not accurate? +REP - Lirbo - 04.06.2017

my friend told me that I should use Floatstr instead of floats over mysql because it's not accurate or something like that, any explainations?


Re: [mysql] float are not accurate? +REP - Vince - 04.06.2017

Yes, rounding errors can occur due to the way floating point numbers are stored but they are accurate enough for their purposes. For example 3.1 might be stored as 3.09999 but no-one's going to notice that a position is off by 1/100,000th of a meter.

https://www.youtube.com/watch?v=PZRI1IfStY0