Skip to content

dec to hex does not work for large integers #390

@bladepan

Description

@bladepan

test case
120222480553230655 and 120222480553230660 produces the same hex string result. this is because https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/MAX_SAFE_INTEGER.
these 2 integers are still in 64bit integer range, so it is a common use case.

> parseInt('120222480553230655').toString(16)
'1ab1db587644140'
> parseInt('120222480553230660').toString(16)
'1ab1db587644140'

> BigInt('120222480553230655').toString(16)
'1ab1db58764413f'
> BigInt('120222480553230660').toString(16)
'1ab1db587644144'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions