From 3da84d8b086bd2d09beb5bdb89ba6beddf1e1dd6 Mon Sep 17 00:00:00 2001 From: Hallam Roberts Date: Fri, 11 Mar 2022 16:14:05 +0100 Subject: Cleanup: use M_PI_2 and M_PI_4 where possible The constant M_PI_4 is added to GLSL to ensure it works there too. Differential Revision: https://developer.blender.org/D14288 --- source/blender/blenlib/intern/math_base_inline.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'source/blender/blenlib/intern/math_base_inline.c') diff --git a/source/blender/blenlib/intern/math_base_inline.c b/source/blender/blenlib/intern/math_base_inline.c index 90a91cbe26f..bb6bc0db00d 100644 --- a/source/blender/blenlib/intern/math_base_inline.c +++ b/source/blender/blenlib/intern/math_base_inline.c @@ -95,10 +95,10 @@ MINLINE float saacos(float fac) MINLINE float saasin(float fac) { if (UNLIKELY(fac <= -1.0f)) { - return (float)-M_PI / 2.0f; + return (float)-M_PI_2; } else if (UNLIKELY(fac >= 1.0f)) { - return (float)M_PI / 2.0f; + return (float)M_PI_2; } else { return asinf(fac); @@ -131,10 +131,10 @@ MINLINE float saacosf(float fac) MINLINE float saasinf(float fac) { if (UNLIKELY(fac <= -1.0f)) { - return (float)-M_PI / 2.0f; + return (float)-M_PI_2; } else if (UNLIKELY(fac >= 1.0f)) { - return (float)M_PI / 2.0f; + return (float)M_PI_2; } else { return asinf(fac); -- cgit v1.2.3