~/lightning

When Computers Can't Math - Floating Point Rounding Error Explained

Lightningat CppCon 2024 · on Sunday, 2024-09-15· [web-performance]
links:none on file
slides:none on file

Explains why 0.1 + 2 does not equal 3 by showing how IEEE 754 32-bit float splits into 1 sign bit, 8 exponent bits, 23 fraction bits, how 0.1 becomes a binary repeating fraction that must be rounded, and how those 23 stored bits produce a value slightly larger than 0.1 so adding yields a result fractionally above 3.0 rather than the exact integer three.

AI-written summary · about

~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.