From 3043b2f7fcf4471983c8d4472b17ccf9df1710c8 Mon Sep 17 00:00:00 2001 From: Micah Cochran Date: Sat, 28 May 2016 11:26:35 -0500 Subject: Change math constants, similar to PR #372. Use M_ namespace with the de facto standard M_PI and its ilk. Change names that are widely used in the project to be in the M_ namespace, so HALFPI becomes M_HALFPI. HALFPI is #defined as M_PI_2 (the defacto standard name). #defines _USE_MATH_DEFINES for MS Visual Studio (I didn't personally test this part, but Appveyor will not build otherwise). --- src/rtodms.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/rtodms.c') diff --git a/src/rtodms.c b/src/rtodms.c index fa7801c5..fa5c3cd1 100644 --- a/src/rtodms.c +++ b/src/rtodms.c @@ -25,7 +25,7 @@ set_rtodms(int fract, int con_w) { for (i = 0; i < fract; ++i) RES *= 10.; RES60 = RES * 60.; - CONV = 180. * 3600. * RES / PI; + CONV = 180. * 3600. * RES / M_PI; if (! con_w) (void)sprintf(format,"%%dd%%d'%%.%df\"%%c", fract); else -- cgit v1.2.3