While working/testing/failing those souped up divide routines, I came across something.
Don't know if it's a bug, or just plain unavoidable...
The loop never stops! Ever!Code:mn = -2147483600 'almost max'd out at 31 bits mx = 2147483600 'almost max'd out at 31 bits st = 1234567 'step size can vary quite a bit x var long For x = mn to mx step st lcdout $fe , 1 , HEX4 x.word1 , ":" , HEX4 x.word0 Next x
It seems that when the step size is larger than the difference between 2^31 -1 and mx, x will roll over from a positive number to a negative number (high bit set) and the loop will keep running. Conversely, if using a negative step size, x will roll over from a negative number to a positive number and the loop will keep running as before.
Looks to me like it's an unavoidable situation...
Any thoughts?




but maybe it is something with PBPL?


Bookmarks