From 130c559e83c6dedc94b820411a9e9d0995c6bcc0 Mon Sep 17 00:00:00 2001 From: Etienne Jacques Date: Fri, 10 Feb 2017 22:16:10 -0800 Subject: Fix compilation with gcc with -std=c11 option. --- src/projects.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src') diff --git a/src/projects.h b/src/projects.h index 33af9ca7..f64d1a4f 100644 --- a/src/projects.h +++ b/src/projects.h @@ -105,6 +105,12 @@ extern double hypot(double, double); #define M_PI 3.14159265358979310 #define M_PI_2 1.57079632679489660 #define M_PI_4 0.78539816339744828 +#define M_2_PI 0.63661977236758134308 +#endif + +/* M_SQRT2 might be missing */ +#ifndef M_SQRT2 +#define M_SQRT2 1.41421356237309504880 #endif /* some more useful math constants and aliases */ -- cgit v1.2.3 From 0ad4e2af7b3e188f71e77ca71a1aacc1fa1a7647 Mon Sep 17 00:00:00 2001 From: Etienne Jacques Date: Fri, 10 Feb 2017 22:26:54 -0800 Subject: Consistent precision for mathematical macros --- src/projects.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/projects.h b/src/projects.h index f64d1a4f..5931e424 100644 --- a/src/projects.h +++ b/src/projects.h @@ -102,9 +102,9 @@ extern double hypot(double, double); * the -ansi flag. */ #ifndef M_PI -#define M_PI 3.14159265358979310 -#define M_PI_2 1.57079632679489660 -#define M_PI_4 0.78539816339744828 +#define M_PI 3.14159265358979323846 +#define M_PI_2 1.57079632679489661923 +#define M_PI_4 0.78539816339744830962 #define M_2_PI 0.63661977236758134308 #endif -- cgit v1.2.3