RE: BUG! Erratic for loop behavior
- Posted by dm31 at uow.edu.au Mar 24, 2002
- 508 views
> That is one heck of a sentence! After 3 minutes, i am still re-reading it to see > if i really know what you meant. > > Kat Sorry Kat, Early morning is not a good time for making sense. What i'm saying is a floating point number is stored in two parts 1. the mantissa 2. the exponent an example is the 0.1 is stored as 1 x 10^-1 thus the mantissa is 1 and the exponent is -1 so using a 8-bit float as an example 0.1 in binary is 0001 and 1111(-1 in 2's complement) So storing numbers like 0.1, 0.3 and 0.01 completely accurately should not be a problem. It is only a problem in 'larger' decimal numbers. for i = 31.4 to 31.5 do... should work perfectly. Or am I just been dumb? Dan