Product Site

5.1.7.80. modulo

Returns the remainder after dividing the receiving string by n. The receiving string must be a whole number and n must be a positive whole number. The returned remainder is always in the range 0 through n minus one.

If both the receiving string and n are non-negative whole numbers, the result is the same as the result of the remainder (//) operation.

Example 5.116. String class — modulo method
Say 10~modulo(3)    -- 1
Say (-10)~modulo(3) -- 2