Liking cljdoc? Tell your friends :D

helins.binf.int64

Handling 64-bit integers, miscellaneous coercions and unsigned math operations.

64-bit integers deserves special attention. On the JVM, there is no explicit unsigned 64-bit type and in JS, there are no 64-bit integers at all. This is why creating and handling them in a cross-platform manner, signed or unsigned, is done via this namespace.

On the JVM, unsigned 64-bit integers are actually regular 64-bit signed values but treated differently. What matters is the bit pattern. For human-readability, see str-u.

In JS, they are BigInt, a type which does not even interoperate with regular numbers.

As a rule, all values in any operation must be 64-bit integers since THEY DO NOT MIX with <= 32-bit integers. This namespace provides functions for logical and mathematical operations for which sign matters (such as u<= or udiv) as well as bitwise operations which need an alternative implementation (such as bit-clear).

Handling 64-bit integers, miscellaneous coercions and unsigned math operations.

64-bit integers deserves special attention. On the JVM, there is no explicit unsigned 64-bit
type and in JS, there are no 64-bit integers at all. This is why creating and handling them in
a cross-platform manner, signed or unsigned, is done via this namespace.

On the JVM, unsigned 64-bit integers are actually regular 64-bit signed values but treated differently.
What matters is the bit pattern. For human-readability, see [[str-u]].

In JS, they are `BigInt`, a type which does not even interoperate with regular numbers.

As a rule, all values in any operation must be 64-bit integers since THEY DO NOT MIX with <= 32-bit integers.
This namespace provides functions for logical and mathematical operations for which sign matters (such as [[u<=]]
or [[udiv]]) as well as bitwise operations which need an alternative implementation (such as [[bit-clear]]).
raw docstring

bit-clearclj/s

(bit-clear x n)

64-bit equivalent of the related standard function.

64-bit equivalent of the related standard function.
sourceraw docstring

bit-flipclj/s

(bit-flip x n)

64-bit equivalent of the related standard function.

64-bit equivalent of the related standard function.
sourceraw docstring

bit-setclj/s

(bit-set x n)

64-bit equivalent of the related standard function.

64-bit equivalent of the related standard function.
sourceraw docstring

bit-testclj/s

(bit-test x n)

64-bit equivalent of the related standard function.

64-bit equivalent of the related standard function.
sourceraw docstring

i*clj/smacro

(i* n)

Macro for declaring a signed 64-bit integer.

(def n
     (i* -9223372036854775808))
Macro for declaring a signed 64-bit integer.

```clojure
(def n
     (i* -9223372036854775808))
```
sourceraw docstring

i16clj/s

(i16 b64)

Converts a 64-bit integer to a signed 16-bit integer.

Converts a 64-bit integer to a signed 16-bit integer.
sourceraw docstring

i32clj/s

(i32 b64)

Converts a 64-bit integer to a signed 32-bit integer.

Converts a 64-bit integer to a signed 32-bit integer.
sourceraw docstring

i8clj/s

(i8 b64)

Converts a 64-bit integer to a signed 8-bit integer.

Converts a 64-bit integer to a signed 8-bit integer.
sourceraw docstring

str-iclj/s

(str-i i64)
(str-i radix i64)

Converts the given signed 64-bit integer into a string.

A radix can be provided (eg. 16 for hexadecimal or 2 for binary).

Converts the given signed 64-bit integer into a string.

A radix can be provided (eg. 16 for hexadecimal or 2 for binary).
sourceraw docstring

str-uclj/s

(str-u u64)
(str-u radix u64)

Converts the given unsigned 64-bit integer into a string.

A radix can be provided (eg. 16 for hexadecimal or 2 for binary).

Converts the given unsigned 64-bit integer into a string.

A radix can be provided (eg. 16 for hexadecimal or 2 for binary).
sourceraw docstring

u*clj/smacro

(u* n)

Macro for declaring an unsigned 64-bit integer.

(def n
     (u* 18446744073709551615))
Macro for declaring an unsigned 64-bit integer.

```clojure
(def n
     (u* 18446744073709551615))
```
sourceraw docstring

u16clj/s

(u16 b64)

Converts a 64-bit integer to an unsigned 16-bit integer.

Converts a 64-bit integer to an unsigned 16-bit integer.
sourceraw docstring

u32clj/s

(u32 b64)

Converts a 64-bit integer to an unsigned 32-bit integer.

Converts a 64-bit integer to an unsigned 32-bit integer.
sourceraw docstring

u8clj/s

(u8 b64)

Converts a 64-bit integer to an unsigned 8-bit integer.

Converts a 64-bit integer to an unsigned 8-bit integer.
sourceraw docstring

u<clj/s

(u< u64-1 u64-2)

Unsigned 64-bit equivalent of standard <.

Unsigned 64-bit equivalent of standard `<`.
sourceraw docstring

u<=clj/s

(u<= u64-1 u64-2)

Unsigned 64-bit equivalent of standard <=.

Unsigned 64-bit equivalent of standard `<=`.
sourceraw docstring

u>clj/s

(u> u64-1 u64-2)

Unsigned 64-bit equivalent of standard >.

Unsigned 64-bit equivalent of standard `>`.
sourceraw docstring

u>=clj/s

(u>= u64-1 u64-2)

Unsigned 64-bit equivalent of standard >=.

Unsigned 64-bit equivalent of standard `>=`.
sourceraw docstring

u>>clj/s

(u>> x n)

Unsigned bit-shift right.

Unsigned bit-shift right.
sourceraw docstring

udivclj/s

(udiv u64-1 u64-2)

Unsigned division.

Unsigned division.
sourceraw docstring

uremclj/s

(urem u64-1 u64-2)

Unsigned remainder.

Unsigned remainder.
sourceraw docstring

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close