From 1fc3d96c8e0356f85f4c3fef634aff53c09ef29f Mon Sep 17 00:00:00 2001 From: Wenzel Jakob Date: Fri, 6 Dec 2013 09:36:05 +0100 Subject: [PATCH] minor reorganization of constants.h --- include/mitsuba/core/constants.h | 60 ++++++++++++++++++++++---------- 1 file changed, 42 insertions(+), 18 deletions(-) diff --git a/include/mitsuba/core/constants.h b/include/mitsuba/core/constants.h index cb76ff3d..fb7c0671 100644 --- a/include/mitsuba/core/constants.h +++ b/include/mitsuba/core/constants.h @@ -59,25 +59,49 @@ #define RCPOVERFLOW_DBL 0x1p-1024 #endif +#define M_E_FLT 2.71828182845904523536f +#define M_PI_FLT 3.14159265358979323846f +#define INV_PI_FLT 0.31830988618379067154f +#define INV_TWOPI_FLT 0.15915494309189533577f +#define INV_FOURPI_FLT 0.07957747154594766788f +#define SQRT_TWO_FLT 1.41421356237309504880f +#define INV_SQRT_TWO_FLT 0.70710678118654752440f + +#define M_E_DBL 2.71828182845904523536 +#define M_PI_DBL 3.14159265358979323846 +#define INV_PI_DBL 0.31830988618379067154 +#define INV_TWOPI_DBL 0.15915494309189533577 +#define INV_FOURPI_DBL 0.07957747154594766788 +#define SQRT_TWO_DBL 1.41421356237309504880 +#define INV_SQRT_TWO_DBL 0.70710678118654752440 + +#define M_E M_E_DBL +#define M_PI M_PI_DBL +#define INV_PI INV_PI_DBL +#define INV_TWOPI INV_TWOPI_DBL +#define INV_FOURPI INV_FOURPI_DBL +#define SQRT_TWO SQRT_TWO_DBL +#define INV_SQRT_TWO INV_SQRT_TWO_DBL + #ifdef SINGLE_PRECISION -#define M_E 2.71828182845904523536f -#define M_PI 3.14159265358979323846f -#define INV_PI 0.31830988618379067154f -#define INV_TWOPI 0.15915494309189533577f -#define INV_FOURPI 0.07957747154594766788f -#define SQRT_TWO 1.41421356237309504880f -#define INV_SQRT_TWO 0.70710678118654752440f -#define ONE_MINUS_EPS ONE_MINUS_EPS_FLT -#define RCPOVERFLOW RCPOVERFLOW_FLT +#define M_E M_E_FLT +#define M_PI M_PI_FLT +#define INV_PI INV_PI_FLT +#define INV_TWOPI INV_TWOPI_FLT +#define INV_FOURPI INV_FOURPI_FLT +#define SQRT_TWO SQRT_TWO_FLT +#define INV_SQRT_TWO INV_SQRT_TWO_FLT +#define ONE_MINUS_EPS ONE_MINUS_EPS_FLT +#define RCPOVERFLOW RCPOVERFLOW_FLT #else -#define M_E 2.71828182845904523536 -#define M_PI 3.14159265358979323846 -#define INV_PI 0.31830988618379067154 -#define INV_TWOPI 0.15915494309189533577 -#define INV_FOURPI 0.07957747154594766788 -#define SQRT_TWO 1.41421356237309504880 -#define INV_SQRT_TWO 0.70710678118654752440 -#define ONE_MINUS_EPS ONE_MINUS_EPS_DBL -#define RCPOVERFLOW RCPOVERFLOW_DBL +#define M_E M_E_DBL +#define M_PI M_PI_DBL +#define INV_PI INV_PI_DBL +#define INV_TWOPI INV_TWOPI_DBL +#define INV_FOURPI INV_FOURPI_DBL +#define SQRT_TWO SQRT_TWO_DBL +#define INV_SQRT_TWO INV_SQRT_TWO_DBL +#define ONE_MINUS_EPS ONE_MINUS_EPS_DBL +#define RCPOVERFLOW RCPOVERFLOW_DBL #endif #endif /* __MITSUBA_CORE_CONSTANTS_H */