Arithmetic operations for PTC-Lisp runtime.
Provides basic math operations: addition, subtraction, multiplication, division, and utility functions like floor, ceil, round, etc.
Summary
Functions
Modulus with floored division (toward negative infinity).
Integer division (quotient), truncating toward zero.
Remainder with truncated division (toward zero).
Functions
Modulus with floored division (toward negative infinity).
The result has the same sign as the divisor (y).
Matches Clojure's mod function.
Integer division (quotient), truncating toward zero.
Matches Clojure's quot function.
Examples
iex> PtcRunner.Lisp.Runtime.Math.quot(7, 2)
3
iex> PtcRunner.Lisp.Runtime.Math.quot(-7, 2)
-3
iex> PtcRunner.Lisp.Runtime.Math.quot(7.5, 2)
3
Remainder with truncated division (toward zero).
The result has the same sign as the dividend (x).
Matches Clojure's rem function.