SA-MP Forums Archive
Max & Min Float value - 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: Max & Min Float value (/showthread.php?tid=352072)



Max & Min Float value - Terminator3 - 18.06.2012

Can i ask, what is the maximum and minimum size of a float for PAWN ?


Re: Max Float value - ikey07 - 18.06.2012

0.0001 I believe or 0.001


Re: Max Float value - Terminator3 - 18.06.2012

You mean -0.0001 ? i think it's more complicated

i try
pawn Code:
printf("Float: %f", cellmin - 1);
printf("Float: %f", cellmin);
printf("Float: %f", cellmin + 1);
but i get some strange results:
Float: NaN
Float: 0.000000
Float: -0.000000


Re: Max & Min Float value - iggy1 - 18.06.2012

Quote:
Originally Posted by wikipedia
Hence (for the example parameters) the smallest non-zero positive number that can be represented is 1Ч10−101 and the largest is 9999999Ч1090 (9.999999Ч1096), and the full range of numbers is −9.999999Ч1096 through 9.999999Ч1096. The numbers −b1−emax and b1−emax (here, −1Ч10−95 and 1Ч10−95) are the smallest (in magnitude) normal numbers; non-zero numbers between these smallest numbers are called subnormal numbers.
http://en.wikipedia.org/wiki/IEEE_754-2008

I think that is relevant.

If you download the pawno toolkit from compuphase there is a PDF that comes with it called Floating Point Support.pdf that has more info about floats in PAWN.