What is the quickest way to check whether a number is divisible by 2
Someone started and deleted a thread. For those looking for the answer:
https://documentation.xojo.com/api/math/mod.html
check and see if the lowest bit is set
if (number and &b1) > 0
if it is its an odd number
else
if it isnt its even & therefor divisible by 2
end if
dunno if this is quicker than mod but it should be
I tested, they are about the same.
if ( number mod 2 ) = 0 then
// it's even
else
// it's odd
end if