Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
mod with type float
#1
This seems to work backwards, giving division instead of remainder.

Code:
dim i as float
For i = 1 to 255
print int i
if i mod 22=0 then
pause 1
pause 0
cls
end if

next i

If you change the dim i as float to dim i as uinteger, it works perfectly, pausing each screen.
Reply
#2
Will check it. "Mod" is not implemented in ROM (in fact is an operation not supposed for floats, but many compilers implement it, and so ZX Basic must Tongue).
As you point out, It's mostly likely I "inverted" the result, returning the quotient, not the remainder.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)