Thanks guys.  Knew it had to be something simple ;).

- Bill


>All numbers are divisible by any other number as long as that other number
>isn't zero.
>
>I suspect, though, you mean "evenly divisible", such that there's no 
>remainder.
>
>In that case, this is how you do it:
>
>What you want to do is to see if the result matches the result when
>converted to an integer.  Example:
>
>if (a / b) = integer(a / b) then
>   -- Put evenly divisible!
>end if
>
>If a=8.0 and b=3, then the result would be 2.6667, and 2.6667 would not
>equal integer(2.6667), which is 2, so it would fail.
>
>
>Some might suggest checking the modulus of the number.  The mod of evenly
>divisible integers is 0.  This works, EXCEPT you must know for a fact that
>you are comparing integers.  If they are float values (like 8.2) then it
>won't work.
>
>If they are straight integers, then you can do this:
>
>if (a mod b) = 0 then
>   -- Put evenly divisible!
>end if
>
>- Tab

_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com


[To remove yourself from this list, or to change to digest mode, go to
http://www.penworks.com/LUJ/lingo-l.cgi  To post messages to the list,
email [EMAIL PROTECTED]  (Problems, email [EMAIL PROTECTED])
Lingo-L is for learning and helping with programming Lingo.  Thanks!]

Reply via email to