Core/Refactor: Fix alot of Possible loss of fraction warnings

This commit is contained in:
hondacrx
2018-05-07 17:34:41 -04:00
parent daa425b029
commit b2c1554065
17 changed files with 31 additions and 30 deletions
+4 -4
View File
@@ -71,7 +71,7 @@ public static class MathFunctions
/// Returns the clamped value.
/// result = (EpsilonF > Abs(value-calmpedValue)) ? calmpedValue : value;
/// </returns>
/// <remarks><see cref="MathFunctions.EpsilonF"/> is used for tolerance.</remarks>
/// <remarks><see cref="MathFunctions.Epsilon"/> is used for tolerance.</remarks>
public static float Clamp(float value, float calmpedValue)
{
return (Epsilon > Math.Abs(value - calmpedValue)) ? calmpedValue : value;
@@ -81,10 +81,10 @@ public static class MathFunctions
static double eps(double a, double b)
{
double aa = Math.Abs(a) + 1.0;
if (aa == double.PositiveInfinity)
if (double.IsPositiveInfinity(aa))
return double.Epsilon;
else
return double.Epsilon * aa;
return double.Epsilon * aa;
}
public static float lerp(float a, float b, float f)