Skip to content

ErlangBigInteger

[Source]

An integer wider than 64 bits.

It is kept the way the external format keeps it - a sign and a magnitude in base 256, least significant byte first - so nothing is lost on the way in or out, and decimal() is only computed when a person needs to read it.

The magnitude is normalised on construction: trailing zero digits are dropped and zero is stored as no digits with a positive sign. An integer that fits into 64 bits arrives as ErlangInteger instead, so a value that was built here can decode as a different class.

class val ErlangBigInteger is
  Equatable[ErlangBigInteger val] ref,
  Hashable ref,
  Stringable box

Implements


Constructors

create

[Source]

new val create(
  negative': Bool val,
  digits': Array[U8 val] val)
: ErlangBigInteger val^

Parameters

Returns


Public fields

let negative: Bool val

[Source]


let digits: Array[U8 val] val

[Source]


Public Functions

is_zero

[Source]

fun box is_zero()
: Bool val

Returns


eq

[Source]

fun box eq(
  that: ErlangBigInteger val)
: Bool val

Parameters

Returns


hash

[Source]

fun box hash()
: USize val

Returns


decimal

[Source]

The value in base 10, with a leading minus sign when negative.

fun box decimal()
: String iso^

Returns


string

[Source]

fun box string()
: String iso^

Returns


ne

[Source]

fun box ne(
  that: ErlangBigInteger val)
: Bool val

Parameters

Returns