HN Hall of Fame Weekly email

0.30000000000000004

0.30000000000000004.com Books & learning Tutorials & guides Computer science Class of 2021-04 Hall of Fame
Screenshot of 0.30000000000000004.com captured 2026-07-20
Page preview · captured 2026-07-20

Resurfaced independently across 7 calendar years, with breakout response in 4 of them.

submissions
16
submitters
15
observed span
2015–2025
peak thread · 402 comments
768 pts
latest 20+ return · 2022-06-20
56 pts

Submission timeline

2007–2026

One slot for every year since HN launched. Height is that year's peak points; orange marks a 100+ point or 50+ comment breakout. Select a bar to open its strongest thread.

First comments on top threads

HN comment order

The big issue here is what you're going to use your numbers for. If you're going to do a lot of fast floating point operations for something like graphics or neural networks, these errors are fine. Speed is more important than exact accuracy. If you're handling money, or numbers representing some other real, important concern where accuracy matters, most likely any number you intend to show to the user as a number, floats are not what you need. Back when…

mcv·768-point thread·

Just adding 0.1 to 0.2 in the language of your choice can be misleading because printing the number might just cut off the digits at some point. Here's an example using perl5: perl -e 'print 0.1+0.2' yields '0.3', which looks OK, however perl -e 'print 0.1+0.2-0.3' reveals '5.55111512312578e-17' So, it's better to print the result of 0.1+0.2-0.3 For what its worth, perl6 passes this test with flying colours.

Tepix·533-point thread·

Once I wrote a library for double-to-string conversion and vice versa, which handles such roundings nicely: https://github.com/mkupchik/dconvstr Key idea is not just to map binary floating point value X to a decimal floating point value Y, but instead (in extended precision, with 64-bit mantissa) compute an interval of decimal floating point values [Y1, Y2] which maps back to X (in standard precision, with 53-bit mantissa). Then choose such Y from [Y1, Y2] that Y has the shortest decimal representation.

mkup·380-point thread·

A couple of thoughts I've always had about floating-point arithmetic: 1. IMO it's unfortunate that most languages default to floating-point. Most programmers, most of the time, would be better served by slightly slower but less confusing alternatives (it's nice that Raku uses rational numbers by default: similarly for integers, it's great that Python uses arbitrary-precision integers by default). At any rate, programmers would be a lot less confused about floating-point arithmetic if they had to opt in to it…

svat·56-point thread·

The first top-level comment from each of the four biggest threads, in HN’s own order. Excerpts are shortened; open a comment for full context.

Breakout years
4

100+ points or 50+ comments

Total points
1769

reference only — not used in Hall rules or ranking

Total comments
841

reference only — not used in Hall rules or ranking

Every submission

DateTitle as submittedByPointsComments
2015-11-130.30000000000000004First breakoutcocoflunchy533240
2017-04-020.30000000000000004shawndumas380130
2019-12-020.30000000000000004Best threadbeznet768402
2021-03-26Your language isn’t broken, it’s doing floating point mathusrme20
2021-04-17Floating Point MathHall inductiongtirloni20
2021-08-19Floating Point Mathtosh20
2021-09-020.1 and 0.2 = 0.3kinduff22
2021-12-250.30000000000000004.com – Floating Point Mathstanislavb20
2022-04-01Floating Point Mathtosh20
2022-06-20Floating Point MathLatest 20+ point returnhegzploit5665
2024-01-20Floating Point Maththrowup23820
2024-08-12Floating Point Mathjoelanman81
2024-12-290.1 and 0.2 = 0.30000000000000004Fake4d30
2025-02-05Floating Point Mathkrykp10
2025-05-17Floating Point Mathmooreds41
2025-07-07Floating Point Mathdsego20