From: VperuS Date: Tue, 2 Jan 2018 13:06:09 +0000 (+0200) Subject: Fix formating in MathHelper.cs X-Git-Tag: v3.0.0~6^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=f22a18587caf17c807f9c95544ef3521476521e1;p=platform%2Fcore%2Fcsapi%2Fopentk.git Fix formating in MathHelper.cs --- diff --git a/src/OpenTK/Math/MathHelper.cs b/src/OpenTK/Math/MathHelper.cs index 66e0038a..b073a9aa 100644 --- a/src/OpenTK/Math/MathHelper.cs +++ b/src/OpenTK/Math/MathHelper.cs @@ -305,7 +305,8 @@ namespace OpenTK return Math.Max(Math.Min(n, max), min); } - private static unsafe int FloatToInt32Bits(float f) { + private static unsafe int FloatToInt32Bits(float f) + { return *((int*)&f); } @@ -319,7 +320,8 @@ namespace OpenTK /// >the second value to compare /// the number of floating point bits to check /// - public static bool ApproximatelyEqual(float a, float b, int maxDeltaBits) { + public static bool ApproximatelyEqual(float a, float b, int maxDeltaBits) + { // we use longs here, otherwise we run into a two's complement problem, causing this to fail with -2 and 2.0 long aInt = FloatToInt32Bits(a); if (aInt < 0) @@ -449,7 +451,5 @@ namespace OpenTK double diff = Math.Abs(a - b); return diff <= tolerance; } - - - } + } }