# `PtcRunner.Lisp.Runtime.Math`
[🔗](https://github.com/andreasronge/ptc_runner/blob/main/lib/ptc_runner/lisp/runtime/math.ex#L1)

Arithmetic operations for PTC-Lisp runtime.

Provides basic math operations: addition, subtraction, multiplication, division,
and utility functions like floor, ceil, round, etc.

# `abs`

# `add`

# `add`

# `bit_and`

Bitwise AND of all arguments (at least one, all integers).

# `bit_and_not`

Bitwise AND of the first argument with the complement of each subsequent one.

# `bit_clear`

Clear bit `n` of `x` (set it to 0).

# `bit_flip`

Flip bit `n` of `x`.

# `bit_not`

Bitwise complement (two's complement) of an integer.

# `bit_or`

Bitwise OR of all arguments (at least one, all integers).

# `bit_set`

Set bit `n` of `x` to 1.

# `bit_shift_left`

Shift `x` left by `n` bits.

# `bit_shift_right`

Arithmetic shift `x` right by `n` bits (sign-extending).

# `bit_test`

Return true if bit `n` of `x` is set.

# `bit_xor`

Bitwise exclusive OR of all arguments (at least one, all integers).

# `ceil`

# `compare`

# `dec`

# `divide`

# `double`

# `eq`

# `eq_variadic`

# `float`

# `floor`

# `gt`

# `gt_variadic`

# `gte`

# `gte_variadic`

# `inc`

# `int`

# `lt`

# `lt_variadic`

# `lte`

# `lte_variadic`

# `max`

# `min`

# `mod`

Modulus with floored division (toward negative infinity).

The result has the same sign as the divisor (y).
Matches Clojure's `mod` function.

# `multiply`

# `multiply`

# `not_eq`

# `not_eq_variadic`

# `numeric_eq_variadic`

# `pow`

# `quot`

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`

Remainder with truncated division (toward zero).

The result has the same sign as the dividend (x).
Matches Clojure's `rem` function.

# `round`

# `sqrt`

# `subtract`

# `subtract`

# `trunc`

---

*Consult [api-reference.md](api-reference.md) for complete listing*
