JavaScript runtime incorrectly increments large integer literals (off-by-one due to float precision)
Resolved 💬 2 comments Opened Nov 13, 2025 by gajjardarshithasmukhbhai Closed Nov 29, 2025
Preflight Checklist
- [x] I have searched existing issues and this hasn't been reported yet
- [x] This is a single bug report (please file separate reports for different bugs)
- [x] I am using the latest version of Claude Code
What's Wrong?
Entering large integer literals beyond the safe 64-bit floating-point range causes JavaScript to silently round the value to the nearest representable float. This produces incorrect output and leads to surprising equality comparisons.
Example:
348555896224571969 === 348555896224571970
// true (incorrect from user perspective)
Both numeric literals are parsed as IEEE-754 double-precision floats and rounded to the same stored value, resulting in incorrect comparisons and off-by-one errors.
What Should Happen?
JavaScript should either:
- Preserve the integer exactly, OR
- Throw a clear error or warning (e.g., “Integer literal exceeds safe precision”), OR
- Force the number to be interpreted as a BigInt when it exceeds safe integer range.
Error Messages/Logs
There is no error or warning generated by JavaScript.
This is part of the problem:
JavaScript fails here ⚠️
Console Logs Examples
Input
console.log(348555896224571969);
Output
348555896224571970
Input
console.log(348555896224571969 === 348555896224571970);
Output
true
Steps to Reproduce
- Open the JavaScript console (Chrome, Node.js, browser devtools, etc.)
- Enter the following:
``348555896224571969``
- Observe output:
``348555896224571970``
- Then evaluate:
``348555896224571969 === 348555896224571970``
- Output:
``true``
Claude Model
None
Is this a regression?
Yes, this worked in a previous version
Last Working Version
_No response_
Claude Code Version
Latest
Platform
Anthropic API
Operating System
macOS
Terminal/Shell
Terminal.app (macOS)
Additional Information
_No response_
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗