Decimal to HEX
Write an exact decimal integer in hexadecimal even when it exceeds the safe integer range in JavaScript.
Write an exact decimal integer in hexadecimal even when it exceeds the safe integer range in JavaScript.
How to use
- Copy the sample’s digits from a source that keeps them as text.
- Paste the number and convert to base sixteen without adding separators.
- Compare every digit of the output with the example, including the final 1.
Worked example
Input
9007199254740993Expected result
20000000000001Check the result
The last digit is a useful check that the input was not rounded in transit.