Re: more RANT
- Posted by Andrew Gainey <amgainey at CUSTOM.NET> Apr 11, 1999
- 494 views
A simple function would be: function DivEvenly(atom num, atom den) -- num is Numerator den is Denominator return num/den = floor(num/den) end function The return value will be zero if it doesn't divide evenly and nonzero if it does. So, If DivEvenly(10, 5) then puts(1,"Yes") end if will print "Yes" and If DivEvenly(23, -14) then puts(1,"Yes") end if will print nothing. This may be faster than using integer() or remainder(), although it does use floor(). You could also just use the formula num/den = floor(num/den) in the actual line testing the two numbers instead of putting it into a function. That might also speed things up.