FAQ  •  Register  •  Login

mod with type float

<<

britlion

Posts: 677

Joined: Mon Apr 27, 2009 7:26 pm

Location: Slough, Berkshire, UK

Post Mon Feb 27, 2012 6:49 pm

mod with type float

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.
<<

boriel

Site Admin

Posts: 1143

Joined: Wed Nov 01, 2006 6:18 pm

Location: Santa Cruz de Tenerife, Spain

Post Wed Feb 29, 2012 2:08 pm

Re: mod with type float

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 :P).
As you point out, It's mostly likely I "inverted" the result, returning the quotient, not the remainder.

Return to Bug Reports

Who is online

Users browsing this forum: No registered users and 1 guest

cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by Vjacheslav Trushkin for Free Forums/DivisionCore.

phpBB SEO