[Gambas-user] Issue 95 in gambas: FOR-optimization not correct

gambas at ...2524... gambas at ...2524...
Thu Sep 1 10:56:00 CEST 2011


Comment #3 on issue 95 by emil.len... at ...626...: FOR-optimization not  
correct
http://code.google.com/p/gambas/issues/detail?id=95

Critical: The current solution is not correct for floating point numbers.
In this case:
   Dim i As Float
   For i = -10.0 To -1.0 Step 1.0
     Print i
   Next
The loop terminates before it is entered. That is because, if you take the  
*(long long int*)&a_double - *(long long int*)&another_double, the result  
will be reversed if both are negative, as floating point numbers are not  
twos complement.





More information about the User mailing list