Grounds
    Preparing search index...

    Function U64

    • Creates an unsigned 64-bit integer Relish value using JavaScript BigInt.

      Use this for large integers beyond JavaScript's safe integer range (2^53-1).

      Parameters

      • value: bigint

        BigInt in range 0-18446744073709551615

      Returns RelishU64

      RelishU64 value

      Error if value is out of range

      import { U64 } from '@grounds/core';

      const valid = U64(BigInt('9007199254740992'));
      const max = U64(BigInt('18446744073709551615'));
      const zero = U64(0n);

      // Runtime errors:
      // U64(-1n) // Error: out of range
      // U64(BigInt('18446744073709551616')) // Error: out of range
      • U32 for 32-bit unsigned
      • U128 for 128-bit unsigned