This is the latest docs version
Quick Links
  • -Overview
  • -Language Features
  • -JS Interop
  • -Build System
Documentation
Language Manual
Reference for all language features
ReScript & React
First class bindings for ReactJS
GenType
Seamless TypeScript integration
Reanalyze
Dead Code & Termination analysis
Exploration
Packages
Explore third party libraries and bindings
Syntax Lookup
Discover all syntax constructs
APIPlaygroundBlogCommunity
  • Playground
  • Blog
  • Twitter
  • GitHub
  • Forum
Core Module
Overview
Core
submodules
  • Array
  • ArrayBuffer
  • AsyncIterator
  • BigInt
    • v
      asIntN
    • v
      asUintN
    • v
      fromString
    • v
      fromStringExn
    • v
      fromInt
    • v
      fromFloat
    • v
      toString
    • v
      toStringWithRadix
      D
    • v
      toLocaleString
    • v
      toFloat
    • v
      toInt
    • v
      +
    • v
      -
    • v
      *
    • v
      /
    • v
      ~-
    • v
      ~+
    • v
      **
    • v
      add
    • v
      sub
    • v
      mul
    • v
      div
    • v
      mod
    • v
      land
    • v
      lor
    • v
      lxor
    • v
      lsl
    • v
      asr
    • v
      lnot
  • BigInt64Array
    • Constants
    BigUint64Array
    • Constants
  • Console
  • DataView
  • Date
    • UTC
  • Dict
  • Error
    • URIError
    • TypeError
    • SyntaxError
    • ReferenceError
    • RangeError
    • EvalError
  • Exn
  • Float
    • Constants
    Float32Array
    • Constants
    Float64Array
    • Constants
    Int
    • Constants
    Int16Array
    • Constants
    Int32Array
    • Constants
    Int8Array
    • Constants
  • Internal
  • Intl
    • Segments
    • Segmenter
    • RelativeTimeFormat
    • PluralRules
    • NumberFormat
      • Grouping
    • Locale
    • ListFormat
    • DateTimeFormat
    • Collator
    • Common
  • Iterator
  • JSON
    • Decode
    • Encode
    • Classify
  • List
  • Map
  • MapperRt
  • Math
    • Int
    • Constants
  • Null
  • Nullable
  • Object
  • Option
  • Ordering
  • Promise
  • Re
    • Result
    RegExp
    • Result
  • Result
  • Set
  • String
  • Symbol
  • Type
    • Classify
  • TypedArray
  • Uint16Array
    • Constants
    Uint32Array
    • Constants
    Uint8Array
    • Constants
    Uint8ClampedArray
    • Constants
  • WeakMap
  • WeakSet
  • API / Core / Bigint

    BigInt

    asIntN

    RESCRIPT
    let asIntN: (~width: int, bigint) => bigint

    asUintN

    RESCRIPT
    let asUintN: (~width: int, bigint) => bigint

    fromString

    RESCRIPT
    let fromString: string => bigint

    fromStringExn

    RESCRIPT
    let fromStringExn: string => bigint

    Parses the given string into a bigint using JavaScript semantics. Return the number as a bigint if successfully parsed. Uncaught syntax exception otherwise.

    Examples

    RESCRIPT
    /* returns 123n */ BigInt.fromStringExn("123") /* returns 0n */ BigInt.fromStringExn("") /* returns 17n */ BigInt.fromStringExn("0x11") /* returns 3n */ BigInt.fromStringExn("0b11") /* returns 9n */ BigInt.fromStringExn("0o11") /* catch exception */ try { BigInt.fromStringExn("a") } catch { | Exn.Error(_error) => 0n }

    fromInt

    RESCRIPT
    let fromInt: int => bigint

    fromFloat

    RESCRIPT
    let fromFloat: float => bigint

    toString

    RESCRIPT
    let toString: (bigint, ~radix: int=?) => string

    Formats a bigint as a string. Return a string representing the given value. See toString on MDN.

    Examples

    RESCRIPT
    /* prints "123" */ Js.BigInt.toString(123n)->Js.log

    toStringWithRadix

    Deprecated

    Use toString with ~radix instead

    RESCRIPT
    let toStringWithRadix: (bigint, ~radix: int) => string

    toLocaleString

    RESCRIPT
    let toLocaleString: bigint => string

    Returns a string with a language-sensitive representation of this BigInt value.

    Examples

    RESCRIPT
    /* prints "123" */ Js.BigInt.toString(123n)->Js.log

    toFloat

    RESCRIPT
    let toFloat: bigint => float

    toInt

    RESCRIPT
    let toInt: bigint => int

    +

    RESCRIPT
    let +: (bigint, bigint) => bigint

    -

    RESCRIPT
    let -: (bigint, bigint) => bigint

    *

    RESCRIPT
    let *: (bigint, bigint) => bigint

    /

    RESCRIPT
    let /: (bigint, bigint) => bigint

    ~-

    RESCRIPT
    let ~-: bigint => bigint

    ~+

    RESCRIPT
    let ~+: bigint => bigint

    **

    RESCRIPT
    let **: (bigint, bigint) => bigint

    add

    RESCRIPT
    let add: (bigint, bigint) => bigint

    sub

    RESCRIPT
    let sub: (bigint, bigint) => bigint

    mul

    RESCRIPT
    let mul: (bigint, bigint) => bigint

    div

    RESCRIPT
    let div: (bigint, bigint) => bigint

    mod

    RESCRIPT
    let mod: (bigint, bigint) => bigint

    land

    RESCRIPT
    let land: (bigint, bigint) => bigint

    lor

    RESCRIPT
    let lor: (bigint, bigint) => bigint

    lxor

    RESCRIPT
    let lxor: (bigint, bigint) => bigint

    lsl

    RESCRIPT
    let lsl: (bigint, bigint) => bigint

    asr

    RESCRIPT
    let asr: (bigint, bigint) => bigint

    lnot

    RESCRIPT
    let lnot: bigint => bigint
    Types and values
    • v
      asIntN
    • v
      asUintN
    • v
      fromString
    • v
      fromStringExn
    • v
      fromInt
    • v
      fromFloat
    • v
      toString
    • v
      toStringWithRadix
      D
    • v
      toLocaleString
    • v
      toFloat
    • v
      toInt
    • v
      +
    • v
      -
    • v
      *
    • v
      /
    • v
      ~-
    • v
      ~+
    • v
      **
    • v
      add
    • v
      sub
    • v
      mul
    • v
      div
    • v
      mod
    • v
      land
    • v
      lor
    • v
      lxor
    • v
      lsl
    • v
      asr
    • v
      lnot

    © 2024 The ReScript Project

    Software and assets distribution powered by KeyCDN.

    About
    • Community
    • ReScript Association
    Find us on