Function Entry: REM

← Prev | ↑ Chapter | Next → | Index | Symbols

Function Entry: REM

Name

rem

Class

Function

Syntax

(rem [number number ...])

Arguments and Values

  • number: zero or more integers or reals.

Description

Divides the first number by the second, and returns the remainder. With more than two arguments, evaluates left to right: the remainder of (rem n1 n2) is divided by n3, and so on. With no arguments, returns 0; with a single argument, returns that argument.

Return Values

If any argument is a real, the result is a real; otherwise the result is an integer.

Side Effects

None.

Examples

  • (rem 42 12) returns 6.
  • (rem 12.0 16) returns 12.0.
  • (rem 26 7 2) returns 1 ((26 mod 7) = 5, then (5 mod 2) = 1).

Availability

  • AutoCAD 2026: documented.
  • BricsCAD V26: documented under the same name rem and additionally provides mod. See Phase 4 cross-reference to BricsCAD mod.
  • Status: AutoCAD documented; BricsCAD presumed-both pending Phase 4 verification.