From 5534828032730762f8c1e4daf924b466fffb8be0 Mon Sep 17 00:00:00 2001 From: chai Date: Tue, 16 Oct 2018 23:09:18 +0800 Subject: =?UTF-8?q?*=E6=A0=BC=E5=BC=8F=E5=8C=96=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/libjin/Math/Math.h | 108 ++++++++++++++++++++++++------------------------- 1 file changed, 54 insertions(+), 54 deletions(-) (limited to 'src/libjin/Math/Math.h') diff --git a/src/libjin/Math/Math.h b/src/libjin/Math/Math.h index 6eb4367..98f9cd8 100644 --- a/src/libjin/Math/Math.h +++ b/src/libjin/Math/Math.h @@ -7,71 +7,71 @@ namespace jin { -namespace math -{ + namespace math + { -#ifdef min -# undef min -#endif // min -#ifdef max -# undef max -#endif // max + #ifdef min + # undef min + #endif // min + #ifdef max + # undef max + #endif // max - template - inline T min(T a, T b) - { - return a < b ? a : b; - } + template + inline T min(T a, T b) + { + return a < b ? a : b; + } - template - inline T max(T a, T b) - { - return a > b ? a : b; - } + template + inline T max(T a, T b) + { + return a > b ? a : b; + } - template - inline T clamp(T a, T mi, T ma) - { - return min(max(a, mi), ma); - } + template + inline T clamp(T a, T mi, T ma) + { + return min(max(a, mi), ma); + } - template - inline bool within(T a, T mi, T ma) - { - return a >= mi && a <= ma; - } + template + inline bool within(T a, T mi, T ma) + { + return a >= mi && a <= ma; + } - template - inline bool without(T a, T mi, T ma) - { - return a < mi || a > ma; - } + template + inline bool without(T a, T mi, T ma) + { + return a < mi || a > ma; + } - template - inline T abs(T a) - { - return a > 0 ? a : -a; - } + template + inline T abs(T a) + { + return a > 0 ? a : -a; + } - template - inline T lowerBound(T a, T lower) - { - return a < lower ? lower : a; - } + template + inline T lowerBound(T a, T lower) + { + return a < lower ? lower : a; + } - template - inline T upperBound(T a, T upper) - { - return a > upper ? upper : a; - } + template + inline T upperBound(T a, T upper) + { + return a > upper ? upper : a; + } - template - inline T lerp(T a, T b, float t) - { - return a + t * (b - a); - } + template + inline T lerp(T a, T b, float t) + { + return a + t * (b - a); + } -} // math + } // math } // jin #endif \ No newline at end of file -- cgit v1.1-26-g67d0