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
  • X
  • Bluesky
  • GitHub
  • Forum
Core Module
Overview
Core
submodules
  • Array
  • ArrayBuffer
  • AsyncIterator
  • BigInt
  • BigInt64Array
    • Constants
    BigUint64Array
    • Constants
  • Console
  • DataView
  • Date
    • UTC
  • Dict
  • Error
    • URIError
    • TypeError
    • SyntaxError
    • ReferenceError
    • RangeError
    • EvalError
  • Exn
  • Float
    • Constants
    Float32Array
    • Constants
    Float64Array
    • Constants
    Int
    • Bitwise
    • Constants
    Int16Array
    • Constants
    Int32Array
    • Constants
    Int8Array
    • Constants
    Intl
    • Segments
    • Segmenter
    • RelativeTimeFormat
    • PluralRules
    • NumberFormat
      • Grouping
    • Locale
    • ListFormat
    • DateTimeFormat
    • Collator
    • Common
  • Iterator
  • JSON
    • Decode
    • Encode
    • Classify
  • List
  • Map
  • Math
    • Int
    • Constants
  • Null
  • Nullable
  • Object
  • Option
  • Ordering
  • Promise
  • RegExp
    • Result
  • Result
  • Set
  • String
  • Symbol
  • Type
    • Classify
  • TypedArray
  • Uint16Array
    • Constants
    Uint32Array
    • Constants
    Uint8Array
    • Constants
    Uint8ClampedArray
    • Constants
  • WeakMap
  • WeakSet
  • API / Core / Int / Bitwise

    Bitwise

    land

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

    land(n1, n2) calculates the bitwise logical AND of two integers.

    Examples

    RESCRIPT
    Int.Bitwise.land(7, 4) == 4

    lor

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

    lor(n1, n2) calculates the bitwise logical OR of two integers.

    Examples

    RESCRIPT
    Int.Bitwise.lor(7, 4) == 7

    lxor

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

    lxor(n1, n2) calculates the bitwise logical XOR of two integers.

    Examples

    RESCRIPT
    Int.Bitwise.lxor(7, 4) == 3

    lnot

    RESCRIPT
    let lnot: int => int

    lnot(n) calculates the bitwise logical NOT of an integer.

    Examples

    RESCRIPT
    Int.Bitwise.lnot(2) == -3

    lsl

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

    lsl(n, length) calculates the bitwise logical left shift of an integer n by length.

    Examples

    RESCRIPT
    Int.Bitwise.lsl(4, 1) == 8

    lsr

    RESCRIPT
    let lsr: (int, int) => int

    lsr(n, length) calculates the bitwise logical right shift of an integer n by length.

    Examples

    RESCRIPT
    Int.Bitwise.lsr(8, 1) == 4

    asr

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

    asr(n, length) calculates the bitwise arithmetic right shift of an integer n by length.

    Examples

    RESCRIPT
    Int.Bitwise.asr(4, 1) == 2
    Types and values
    • v
      land
    • v
      lor
    • v
      lxor
    • v
      lnot
    • v
      lsl
    • v
      lsr
    • v
      asr

    © 2024 The ReScript Project

    Software and assets distribution powered by KeyCDN.

    About
    • Community
    • ReScript Association
    Find us on