Module Javascript.Num

type t

Conversions

val of_string_unsafe : string -> t
val of_targetint : Targetint.t -> t
val of_float : float -> t
val to_string : ?minify:bool -> t -> string

to_string ~minify:true applies cosmetic compaction (strips the leading zero of 0.D…/-0.D… literals and normalizes exponents); ~minify:false (the default) returns the literal verbatim, preserving --pretty output.

val to_targetint : t -> Targetint.t
val hash : t -> int

Predicates

val is_zero : t -> bool
val is_one : t -> bool
val is_neg : t -> bool
val equal : t -> t -> bool

Arithmetic

val add : t -> t -> t
val neg : t -> t