use CannyFastMath in various places even where it might not be any different

also update a bunch of packages

clean up redundant YamlDotNet references
This commit is contained in:
Tyler Young
2020-06-13 01:28:28 -04:00
parent 916b9a67d8
commit de274de9e3
25 changed files with 71 additions and 66 deletions

View File

@@ -30,11 +30,6 @@ namespace Content.Shared.Chemistry
return new ReagentUnit(value * (int) Math.Pow(10, Shift));
}
public static ReagentUnit New(decimal value)
{
return new ReagentUnit((int) Math.Round(value * (decimal) Math.Pow(10, Shift), MidpointRounding.AwayFromZero));
}
public static ReagentUnit New(float value)
{
return new ReagentUnit(FromFloat(value));
@@ -42,7 +37,7 @@ namespace Content.Shared.Chemistry
private static int FromFloat(float value)
{
return (int) Math.Round(value * (float) Math.Pow(10, Shift), MidpointRounding.AwayFromZero);
return (int) MathF.Round(value * MathF.Pow(10, Shift), MidpointRounding.AwayFromZero);
}
public static ReagentUnit New(double value)
@@ -83,12 +78,6 @@ namespace Content.Shared.Chemistry
return New(aD * b);
}
public static ReagentUnit operator *(ReagentUnit a, decimal b)
{
var aD = (decimal) a.ShiftDown();
return New(aD * b);
}
public static ReagentUnit operator *(ReagentUnit a, double b)
{
var aD = a.ShiftDown();
@@ -166,11 +155,6 @@ namespace Content.Shared.Chemistry
return (float) ShiftDown();
}
public decimal Decimal()
{
return (decimal) ShiftDown();
}
public double Double()
{
return ShiftDown();