Module Js.Bigint
Bindings to functions in JavaScript's BigInt
JavaScript BigInt API
ocaml
type t = Js.bigintreasonml
type t = Js.bigint;ocaml
val make : 'a -> treasonml
let make: 'a => t;make repr creates a new BigInt from the representation repr. repr can be a number, a string, boolean, etc.
ocaml
val asIntN : precision:int -> t -> treasonml
let asIntN: precision:int => t => t;asIntN ~precision bigint truncates the BigInt value of bigint to the given number of least significant bits specified by precision and returns that value as a signed integer.
ocaml
val asUintN : precision:int -> t -> treasonml
let asUintN: precision:int => t => t;asUintN ~precision bigint truncates the BigInt value of bigint to the given number of least significant bits specified by precision and returns that value as an unsigned integer.
ocaml
type toLocaleStringOptions = {
style : string;
currency : string;
}reasonml
type toLocaleStringOptions = {
style: string,
currency: string,
};ocaml
val toLocaleString :
locale:string ->
?options:toLocaleStringOptions ->
t ->
stringreasonml
let toLocaleString:
locale:string =>
?options:toLocaleStringOptions =>
t =>
string;toLocaleString bigint returns a string with a language-sensitive representation of this BigInt.
ocaml
val toString : t -> stringreasonml
let toString: t => string;toString bigint returns a string representing the specified BigInt value.
ocaml
val neg : t -> treasonml
let neg: t => t;ocaml
val add : t -> t -> treasonml
let add: t => t => t;ocaml
val sub : t -> t -> treasonml
let sub: t => t => t;Subtraction.
ocaml
val mul : t -> t -> treasonml
let mul: t => t => t;Multiplication.
ocaml
val div : t -> t -> treasonml
let div: t => t => t;Division.
ocaml
val rem : t -> t -> treasonml
let rem: t => t => t;