Binary "%" computes the modulus of two numbers.Given integer operands $a and $b: If $b is positive, then "$a % $b" is $a minus the largest multiple of $b that is not greater than $a. If $b is negative then "$a % $b" is $a minus the smallest multiple of $b that is not less tha +n $a (i.e. the result will be less than or equal to zero). Note that when "use integer" is in scope "%" gives you direct access to the mod- ulus operator as implemented by your C compiler. This operator is not as well defined for negative operands, but it will execute faster.
In reply to Re^3: Find if a number is a multiple of a number.
by borisz
in thread Find if a number is a multiple of a number.
by Baratski
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |