JavaScript runtime has an off-by-one bug :) I recently stumbled

Arpit Bhayani

Arpit Bhayani

Nov 13, 2025 • 1 min read


JavaScript runtime has an off-by-one bug :) I recently stumbled upon a claude code issue where running

echo 348555896224571969  

actually executes in Bash and outputs 348555896224571970, which is off by exactly 1.

This happens because of JavaScript’s floating-point precision limits. Numbers above 2^53 lose precision when converted, causing the display to round incorrectly - a classic off-by-one error hiding in the rendering layer.

You can reproduce this in claude code and even in your JS console by typing the number 348555896224571969.

Fascinating :)

Arpit Bhayani

Principal Engineer II at Razorpay - building Agent Studio, Ex-staff engg at GCP Memorystore & Dataproc, Creator of DiceDB, ex-Amazon Fast Data, ex-Director of Engg. SRE and Data Engineering at Unacademy. I spark engineering curiosity through my no-fluff engineering videos on YouTube and my courses