[Gambas-user] Issue 165 in gambas: Arithmetic problem with float

gambas at ...2524... gambas at ...2524...
Thu Dec 22 19:10:08 CET 2011


Comment #2 on issue 165 by jussi.la... at ...626...: Arithmetic problem with  
float
http://code.google.com/p/gambas/issues/detail?id=165

Not sure.

Dim ff As Float

ff = Log2(536870912)
Print ff

ff = CInt(Log2(536870912))
Print ff

Print Log2(536870912) <> CInt(Log2(536870912))

Result:
*29*
*29*
*True* (expected is False!)

Again, behaviour tested with C.

     double a = log2(536870912);
     printf ("%10.52f \n", a);


Jussi





More information about the User mailing list