From 01392623a855b3911f6924ba47c3ee94f085fef5 Mon Sep 17 00:00:00 2001 From: Marek Safar Date: Wed, 19 Sep 2018 20:37:17 +0200 Subject: [PATCH] Turns Math/MathF RoundLimit into a constant (dotnet/coreclr#20044) Commit migrated from https://github.com/dotnet/coreclr/commit/f52dfe474bd2462599f704346c80df5fbb80dfc3 --- src/libraries/System.Private.CoreLib/src/System/Math.cs | 2 +- src/libraries/System.Private.CoreLib/src/System/MathF.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/libraries/System.Private.CoreLib/src/System/Math.cs b/src/libraries/System.Private.CoreLib/src/System/Math.cs index ef46869..b211d39 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Math.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Math.cs @@ -28,7 +28,7 @@ namespace System private const int maxRoundingDigits = 15; - private static double doubleRoundLimit = 1e16d; + private const double doubleRoundLimit = 1e16d; // This table is required for the Round function which can specify the number of digits to round to private static double[] roundPower10Double = new double[] { diff --git a/src/libraries/System.Private.CoreLib/src/System/MathF.cs b/src/libraries/System.Private.CoreLib/src/System/MathF.cs index 5b7e48b..7769023 100644 --- a/src/libraries/System.Private.CoreLib/src/System/MathF.cs +++ b/src/libraries/System.Private.CoreLib/src/System/MathF.cs @@ -28,7 +28,7 @@ namespace System 1e0f, 1e1f, 1e2f, 1e3f, 1e4f, 1e5f, 1e6f }; - private static float singleRoundLimit = 1e8f; + private const float singleRoundLimit = 1e8f; [MethodImpl(MethodImplOptions.AggressiveInlining)] public static float Abs(float x) -- 2.7.4