How to use the @xtuc/long.fromNumber function in @xtuc/long

To help you get started, we’ve selected a few @xtuc/long examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github xtuc / webassemblyjs / packages / webassemblyjs / src / interpreter / runtime / values / i32.js View on Github external
mul(operand: i32): i32 {
    // https://webassembly.github.io/spec/core/exec/numerics.html#op-imul
    return new i32(
      Long.fromNumber(this._value)
        .mul(Long.fromNumber(operand._value))
        .mod(Math.pow(2, bits))
        .toNumber()
    );
  }
github xtuc / webassemblyjs / packages / webassemblyjs / src / interpreter / runtime / values / i32.js View on Github external
mul(operand: i32): i32 {
    // https://webassembly.github.io/spec/core/exec/numerics.html#op-imul
    return new i32(
      Long.fromNumber(this._value)
        .mul(Long.fromNumber(operand._value))
        .mod(Math.pow(2, bits))
        .toNumber()
    );
  }

@xtuc/long

A Long class for representing a 64-bit two's-complement integer value.

Apache-2.0
Latest version published 5 years ago

Package Health Score

70 / 100
Full package analysis