Re: magic integer converter number 62? (John W Baxter)
Re: magic integer converter number 62? (John W Baxter)
- Subject: Re: magic integer converter number 62? (John W Baxter)
- From: Nigel Smith <email@hidden>
- Date: Thu, 22 Feb 2001 10:39:08 +0000
NG suggested using
num div 1
in response to MShaw's need to recreate(?)
on floor(num)
return (((100 + (num - (num mod 1))) - 100) as integer)
end int
I may be wrong, I'm no programmer, but isn't floor *always* rounding down? ie:
floor(5.5) = 5
floor(-5.5) = -6
In which case
on floor(num)
if num < 0 then
return (num div 1) - 1
else
return num div 1
end if
end floor
...should do the business (though someone is bound to point out a quicker
way!).
Nigel