From: Jan Kotas Date: Tue, 26 Sep 2017 00:17:20 +0000 (-0700) Subject: Fix modf and fmod casing for consistency X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=4ade034c829a38a656cbe52a96fbfc98275bbc46;p=platform%2Fupstream%2Fcoreclr.git Fix modf and fmod casing for consistency Signed-off-by: dotnet-bot --- diff --git a/src/mscorlib/shared/System/Math.cs b/src/mscorlib/shared/System/Math.cs index 174e2f6be5..5c69c84e45 100644 --- a/src/mscorlib/shared/System/Math.cs +++ b/src/mscorlib/shared/System/Math.cs @@ -624,7 +624,7 @@ namespace System double flrTempVal = Floor(a + 0.5); - if ((a == (Floor(a) + 0.5)) && (fmod(flrTempVal, 2.0) != 0)) + if ((a == (Floor(a) + 0.5)) && (FMod(flrTempVal, 2.0) != 0)) { flrTempVal -= 1.0; } @@ -664,7 +664,7 @@ namespace System if (mode == MidpointRounding.AwayFromZero) { - var fraction = modf(value, &value); + var fraction = ModF(value, &value); if (Abs(fraction) >= 0.5) { @@ -755,7 +755,7 @@ namespace System public static unsafe double Truncate(double d) { - modf(d, &d); + ModF(d, &d); return d; } diff --git a/src/mscorlib/src/System/Math.CoreCLR.cs b/src/mscorlib/src/System/Math.CoreCLR.cs index d5d9c3d92b..92eb5cf525 100644 --- a/src/mscorlib/src/System/Math.CoreCLR.cs +++ b/src/mscorlib/src/System/Math.CoreCLR.cs @@ -77,9 +77,9 @@ namespace System public static extern double Tanh(double value); [MethodImpl(MethodImplOptions.InternalCall)] - private static extern double fmod(double x, double y); + private static extern double FMod(double x, double y); [MethodImpl(MethodImplOptions.InternalCall)] - private static extern unsafe double modf(double x, double* intptr); + private static extern unsafe double ModF(double x, double* intptr); } } diff --git a/src/vm/ecalllist.h b/src/vm/ecalllist.h index 3c8378764f..4720b5a11f 100644 --- a/src/vm/ecalllist.h +++ b/src/vm/ecalllist.h @@ -652,10 +652,10 @@ FCFuncStart(gMathFuncs) FCIntrinsic("Cosh", COMDouble::Cosh, CORINFO_INTRINSIC_Cosh) FCIntrinsic("Exp", COMDouble::Exp, CORINFO_INTRINSIC_Exp) FCIntrinsic("Floor", COMDouble::Floor, CORINFO_INTRINSIC_Floor) - FCFuncElement("fmod", COMDouble::FMod) + FCFuncElement("FMod", COMDouble::FMod) FCFuncElement("Log", COMDouble::Log) FCIntrinsic("Log10", COMDouble::Log10, CORINFO_INTRINSIC_Log10) - FCFuncElement("modf", COMDouble::ModF) + FCFuncElement("ModF", COMDouble::ModF) FCIntrinsic("Pow", COMDouble::Pow, CORINFO_INTRINSIC_Pow) FCIntrinsic("Sin", COMDouble::Sin, CORINFO_INTRINSIC_Sin) FCIntrinsic("Sinh", COMDouble::Sinh, CORINFO_INTRINSIC_Sinh)