rem

AutoCad AutoLISP Functions

 
rem
 
 
 

Divides the first number by the second, and returns the remainder

(rem [number number...]) 

Arguments

number

Any number.

If you provide more than two numbers, rem divides the result of dividing the first number by the second with the third, and so on.

If you provide more than two numbers, rem evaluates the arguments from left to right. For example, if you supply three numbers, rem divides the first number by the second, then takes the result and divides it by the third number, returning the remainder of that operation.

Return Values

A number. If any number argument is a real, rem returns a real; otherwise, rem returns an integer. If no arguments are supplied, rem returns 0. If a single number argument is supplied, rem returns number.

Examples

Command: (rem 42 12)

6

Command: (rem 12.0 16)

12.0

Command: (rem 26 7 2)

1