fix type in smoothstep

This commit is contained in:
hsv-2 2022-02-08 19:15:44 +01:00
parent f537d94c9c
commit 180e1f77fa

View file

@ -98,7 +98,7 @@ namespace bwidgets
[[nodiscard]] inline auto smoothstep(const N x, const N a, const N b) noexcept
-> float
{
const float x_norm = linear(std::clamp<float>(x, a, b), a, b);
const float x_norm = linear(std::clamp<double>(x, a, b), static_cast<double>(a), static_cast<double>(b));
return 3 * x_norm * x_norm - 2 * x_norm * x_norm * x_norm;
}
}