PicoBlog

Daily bit(e) of C++ | std::lerp

The std::lerp is a C++20 mathematical function that handles linear interpolation (and extrapolation) for floating-point types.

The function takes three arguments: the two boundary values and an interpolation factor. The implementation will correctly handle infinities and boundary values for the interpolation factor.

Leave a comment

ncG1vNJzZmirmaK8r8DOrZ9nq6WXwLWtwqRlnKedZL1wsMCio7Jlkp7BpnnOn2ScZaOpsa2x0ak%3D

Delta Gatti

Update: 2024-12-03