diff options
author | Rajeev Sharma <rdsharma@google.com> | 2012-07-24 15:44:30 -0700 |
---|---|---|
committer | Rajeev Sharma <rdsharma@google.com> | 2012-07-25 10:14:36 -0700 |
commit | 796ea154c3252ad932871678d558d6edefe846fd (patch) | |
tree | 59d2557506485dd7f6d6f159d9bdd2e1d9ed1d72 /scriptc | |
parent | 0bbb8e6c13474a24c0baadab0546d66b7c2bcc2e (diff) | |
download | rs-796ea154c3252ad932871678d558d6edefe846fd.tar.gz |
Add additional math constants
Add math constants which are defined in libc math.h but not ours.
Keep constants in rs_types.rsh instead of rs_math.rsh to avoid
problems with including rs_math.rsh in other projects (namely
libbcc).
Change-Id: Ia67f501353ac6e2311549bef6767e2b182f70132
Diffstat (limited to 'scriptc')
-rw-r--r-- | scriptc/rs_types.rsh | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/scriptc/rs_types.rsh b/scriptc/rs_types.rsh index 04099cdf..5c99313e 100644 --- a/scriptc/rs_types.rsh +++ b/scriptc/rs_types.rsh @@ -41,7 +41,20 @@ #ifndef __RS_TYPES_RSH__ #define __RS_TYPES_RSH__ -#define M_PI 3.14159265358979323846264338327950288f /* pi */ +/* Constants */ +#define M_E 2.718281828459045235360287471352662498f /* e */ +#define M_LOG2E 1.442695040888963407359924681001892137f /* log_2 e */ +#define M_LOG10E 0.434294481903251827651128918916605082f /* log_10 e */ +#define M_LN2 0.693147180559945309417232121458176568f /* log_e 2 */ +#define M_LN10 2.302585092994045684017991454684364208f /* log_e 10 */ +#define M_PI 3.141592653589793238462643383279502884f /* pi */ +#define M_PI_2 1.570796326794896619231321691639751442f /* pi/2 */ +#define M_PI_4 0.785398163397448309615660845819875721f /* pi/4 */ +#define M_1_PI 0.318309886183790671537767526745028724f /* 1/pi */ +#define M_2_PIl 0.636619772367581343075535053490057448f /* 2/pi */ +#define M_2_SQRTPI 1.128379167095512573896158903121545172f /* 2/sqrt(pi) */ +#define M_SQRT2 1.414213562373095048801688724209698079f /* sqrt(2) */ +#define M_SQRT1_2 0.707106781186547524400844362104849039f /* 1/sqrt(2) */ #include "stdbool.h" /** |