maths: allow mix's t to lie outside [0,1] a little

This commit is contained in:
Danny Robson 2018-03-14 18:13:05 +11:00
parent c9dea18881
commit deb787847c

View File

@ -688,8 +688,9 @@ namespace util {
std::enable_if_t<std::is_floating_point<T>::value, U>
mix (U a, U b, T t)
{
assert (t >= 0);
assert (t <= 1);
// give some tolerance for floating point rounding
assert (t >= -0.00001f);
assert (t <= 1.00001f);
return a * (1 - t) + b * t;
}