Lightning Talk: Finding the Average of 2 Integers
summary
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
related talks
35mHonest Performance Testing
02mWhen Computers Can't Math - Floating Point Rounding Error Explained
51mFloating-Point Arithmetic on Deterministic Systems
56mHow to Quickly Convert Floating-Point Numbers in C++
38mStrength in Numbers: Unums and the Quest for Reliable Arithmetic
05mLightning Talk: Micro C++ Benchmarks & Murphy's Law
06mLightning Talk: Pólya Performance Thinking
49mNumbers every Scala programmer should know
