package server-reason-react
Install
dune-project
Dependency
Authors
Maintainers
Sources
sha256=3972f64a3ec22b120b40137f74e7862629b2164e5bbf8b85489d4c7b8bc13288
sha512=24a52537c091c4b278ea5e468aa6786378f8b559ed2128e824b6f84f26c283856a30e7ef01aab6101087bd53b9bdc2ecd8152c00db10bccff67221b9c67318a0
doc/server-reason-react.js/Js/Bigint/index.html
Module Js.BigintSource
Provide utilities for bigint
The BigInt type, representing arbitrary precision integers
Constructors
of_string s creates a BigInt from a string representation. Supports decimal, hexadecimal (0x prefix), binary (0b prefix), and octal (0o prefix) formats. Whitespace is trimmed. Empty string returns 0. Invalid strings return 0.
of_string_exn s creates a BigInt from a string representation. Like of_string but raises Failure on invalid input.
Conversions
to_string ?radix bigint returns a string representation. radix can be 2-36 (default 10).
to_float bigint converts to float. May lose precision for large values.
Arithmetic operations
div x y returns x / y, truncated toward zero. Raises Division_by_zero if y is zero.
rem x y returns the remainder of x / y. The sign follows the dividend (JavaScript semantics). Raises Division_by_zero if y is zero.
pow base exp returns base raised to the power exp. Raises Invalid_argument if exp is negative.
Bitwise operations
shift_right x n returns x arithmetically shifted right by n bits. Sign-extending for negative numbers.
Comparison operations
Bit width conversion
as_int_n bits x wraps x to a signed integer of bits bits. Equivalent to JavaScript's BigInt.asIntN.
as_uint_n bits x wraps x to an unsigned integer of bits bits. Equivalent to JavaScript's BigInt.asUintN.
asIntN ~precision bigint truncates to the precision least significant bits as a signed integer, like JavaScript's BigInt.asIntN.
asUintN ~precision bigint truncates to the precision least significant bits as an unsigned integer, like JavaScript's BigInt.asUintN.
No ICU on the server: ignores locale and options and returns the plain decimal representation.