~/lightning

Lightning Talk: Finding the Average of 2 Integers

Lightningat CppCon 2022 · 2022-09-11..09-16· [web-performance]
links:none on file
slides:none on file

A concrete claim: a function average that converts ints to double by multiplying by 1.0 and adds then divides produces wrong results for some inputs. The presenter demonstrates with an explicit 64‑bit integer n example n not representable by double and shows the computed mean differs and even varies with rounding mode. The core point is double can't represent all midpoints and the implemented average(a,b) converts ints to double via 1.0 fails for large values.

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.