Skip to content
This repository was archived by the owner on Jan 23, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 4 additions & 21 deletions src/mscorlib/src/System/MathF.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,7 @@ public static class MathF
public const float E = 2.71828183f;

[System.Security.SecuritySafeCritical] // auto-generated
[MethodImplAttribute(MethodImplOptions.InternalCall)]
public static extern float Abs(float x);
public static float Abs(float x) => Math.Abs(x);

[System.Security.SecuritySafeCritical] // auto-generated
[MethodImplAttribute(MethodImplOptions.InternalCall)]
Expand Down Expand Up @@ -157,10 +156,10 @@ public static float Log(float x, float y)
public static extern float Log10(float x);

[ReliabilityContract(Consistency.WillNotCorruptState, Cer.Success)]
public static float Max(float x, float y) => ((x > y) || float.IsNaN(x)) ? x : y;
public static float Max(float x, float y) => Math.Max(x, y);

[ReliabilityContract(Consistency.WillNotCorruptState, Cer.Success)]
public static float Min(float x, float y) => ((x < y) || float.IsNaN(x)) ? x : y;
public static float Min(float x, float y) => Math.Min(x, y);

[System.Security.SecuritySafeCritical] // auto-generated
[MethodImplAttribute(MethodImplOptions.InternalCall)]
Expand Down Expand Up @@ -208,23 +207,7 @@ public static float Round(float x, MidpointRounding mode)
return InternalRound(x, 0, mode);
}

public static int Sign(float x)
{
if (x < 0)
{
return -1;
}
else if (x > 0)
{
return 1;
}
else if (x == 0)
{
return 0;
}

throw new ArithmeticException(Environment.GetResourceString("Arithmetic_NaN"));
}
public static int Sign(float x) => Math.Sign(x);

[System.Security.SecuritySafeCritical] // auto-generated
[MethodImplAttribute(MethodImplOptions.InternalCall)]
Expand Down
1 change: 0 additions & 1 deletion src/vm/ecalllist.h
Original file line number Diff line number Diff line change
Expand Up @@ -1252,7 +1252,6 @@ FCFuncStart(gMathFuncs)
FCFuncEnd()

FCFuncStart(gMathFFuncs)
FCIntrinsic("Abs", COMSingle::Abs, CORINFO_INTRINSIC_Abs)
FCIntrinsic("Acos", COMSingle::Acos, CORINFO_INTRINSIC_Acos)
FCIntrinsic("Asin", COMSingle::Asin, CORINFO_INTRINSIC_Asin)
FCIntrinsic("Atan", COMSingle::Atan, CORINFO_INTRINSIC_Atan)
Expand Down