Summary
This episode introduces two new C++20 standard library functions: std::lerp (linear interpolation) and std::midpoint. Jason demonstrates why these functions are necessary by showing how naive implementations can lead to signed integer overflow and undefined behavior when working with values near the limits of numeric types. The specialized implementations in the standard library handle edge cases correctly, making them particularly useful for game development and other applications requiring precise numeric computations.
Related C++ Standard Sections
This episode covers topics found in these sections of the C++ standard:
-
[numeric.ops.midpoint]76% match -
[numeric.limits.members]57% match -
[c.math.lerp]40% match -
[numeric.limits]40% match