JavaScript bug pattern 012 - float precision
Common JavaScript failure involving float precision. Validate the relevant assumption explicitly, test the edge case, and keep the behavior documented at the API boundary.
Appreciate the write-up on "JavaScript bug pattern 012 - float precision". Useful for anyone using javascript / bug-pattern.
Top-notch
- @aarya-mehta▲ 3
Clear note on javascript / bug-pattern. "JavaScript bug pattern 012 - float precision" is the kind of detail that is easy to overlook.
- @dearsohum▲ 3
Appreciate the write-up on "JavaScript bug pattern 012 - float precision". Useful for anyone using javascript / bug-pattern.
- @ohmshawas23▲ 3
Saved
Outstanding
- @narwhalix▲ 3
IEEE 754 doubles make
0.1 + 0.2equal0.30000000000000004, and integers aboveNumber.MAX_SAFE_INTEGERlose precision. UseBigIntfor large integers and store money as integer cents. Other platform gotchas welcome in the comments. - @sohmeh▲ 2
Specific and to the point: "JavaScript bug pattern 012 - float precision". Worth a look if you touch javascript / bug-pattern.
- @hk3narwhal▲ 2
Productive
Accurate
- @saltysamm▲ 2
Specific and to the point: "JavaScript bug pattern 012 - float precision". Worth a look if you touch javascript / bug-pattern.
Polished
- @deneil2121▲ 2
Key
- @ohmshawas23▲ 2
Informative
- @prranit-max▲ 2
Useful practical note—JavaScript bug pattern 012 - float precision is clearly explained, and the edge case plus mitigation are easy to apply.
- @imsa-mehta▲ 2
"JavaScript bug pattern 012 - float precision" is a useful thing to know about with javascript / bug-pattern. Thanks for sharing it.
Specific and to the point: "JavaScript bug pattern 012 - float precision". Worth a look if you touch javascript / bug-pattern.
Actionable
- @mrnarwhal55▲ 1
Sharp
- @narwhalix▲ 1
Top-notch
Precise
Lifesaver
- @sohumm15▲ 1
Appreciate the write-up on "JavaScript bug pattern 012 - float precision". Useful for anyone using javascript / bug-pattern.
Robust
Straightforward
Great