Aggressively inline LerpInternal

This commit is contained in:
Oliver Booth 2021-03-11 16:15:57 +00:00
parent f6b885b46b
commit 8976993cee
1 changed files with 2 additions and 2 deletions

View File

@ -135,12 +135,12 @@ namespace X10D.DoubleExtensions
return Math.Round(value / nearest) * nearest;
}
[MethodImpl(MethodImplOptions.AggressiveInlining)]
private static double LerpInternal(double a, double b, double t)
{
// rookie mistake: a + t * (b - a)
// "precise" method: (1 - t) * a + t * b
return (1 - t) * a + t * b;
return (1.0 - t) * a + t * b;
}
}
}