Skip to content

Some BigInt values are incorrect. #34801

Closed
@bjforte

Description

@bjforte

Node version v12.16.1
64-bit Windows 10 Pro v2004

The BigInt value BigInt(0xFFFFFFFFFFFFFFFF) should be 2^64 - 1 but it's evaluating as 2^64

//Example

const v1 = BigInt(0xFFFFFFFFFFFFFFFF); // 2^64 - 1
const v2 = BigInt(0x10000000000000000); // 2^64

console.log(v1 === v2);
console.log(v1,v2);

// Output

true
18446744073709551616n 18446744073709551616n

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions