Unchecked math where operations are fast but prone to overflow.

Depending on the needs, there are several other namespaces with similar functionalities:

  • dunaj.math which is slightly faster but subject to rounding and truncation

  • dunaj.math.precise, slower but with arbitrary precision, auto-promoting when needed

  • dunaj.host.int, host specific unchecked operations with fastest performance.

*

Available since version 1.0 (view source)

not referred automatically

Usage:
  • (*)

  • (* x)

  • (* x y)

  • (* x y & more)

Type signatures:
  • () → 1

  • (java.lang.Long) → java.lang.Long

  • (java.lang.Long ⨯ java.lang.Long) → java.lang.Long

  • (java.lang.Long ⨯ java.lang.Long ⨯ (Va java.lang.Long)) → java.lang.Long

Returns the unchecked product of nums. (*) returns 1. Subject to overflow.

+

Available since version 1.0 (view source)

not referred automatically

Usage:
  • (+)

  • (+ x)

  • (+ x y)

  • (+ x y & more)

Type signatures:
  • () → 0

  • (java.lang.Long) → java.lang.Long

  • (java.lang.Long ⨯ java.lang.Long) → java.lang.Long

  • (java.lang.Long ⨯ java.lang.Long ⨯ (Va java.lang.Long)) → java.lang.Long

Returns the unchecked sum of nums. (+) returns 0. Subject to overflow.

-

Available since version 1.0 (view source)

not referred automatically

Usage:
  • (- x)

  • (- x y)

  • (- x y & more)

Type signatures:
  • (java.lang.Long) → java.lang.Long

  • (java.lang.Long ⨯ java.lang.Long) → java.lang.Long

  • (java.lang.Long ⨯ java.lang.Long ⨯ (Va java.lang.Long)) → java.lang.Long

If no ys are supplied, returns the unchecked negation of x, else subtracts the ys from x and returns the unchecked result. Subject to overflow.

add

Available since version 1.0 (alias of clojure.core/unchecked-add)

not referred automatically

Usage:
  • (add x y)

Type signature:
  • (Number+ ⨯ Number+) → Number+

Returns the unchecked sum of x and y. Subject to overflow.

dec

Available since version 1.0 (alias of clojure.core/unchecked-dec)

not referred automatically

Usage:
  • (dec x)

Type signature:
  • (Number+) → Number+

Returns a number one less than x. Subject to overflow.

inc

Available since version 1.0 (alias of clojure.core/unchecked-inc)

not referred automatically

Usage:
  • (inc x)

Type signature:
  • (Number+) → Number+

Returns a number one greater than x. Subject to overflow.

multiply

Available since version 1.0 (alias of clojure.core/unchecked-multiply)

not referred automatically

Usage:
  • (multiply x y)

Type signature:
  • (Number+ ⨯ Number+) → Number+

Returns the result of unchecked multiplication of x and y. Subject to overflow.

negate

Available since version 1.0 (alias of clojure.core/unchecked-negate)

not referred automatically

Usage:
  • (negate x)

Type signature:
  • (Number+) → Number+

Returns the unchecked negation of x. Subject to overflow.

subtract

Available since version 1.0 (alias of clojure.core/unchecked-subtract)

not referred automatically

Usage:
  • (subtract x y)

Type signature:
  • (Number+ ⨯ Number+) → Number+

Returns the result of unchecked subtraction of y from x. Subject to overflow.