summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthew Olsson <matthewcolsson@gmail.com>2021-04-22 21:34:11 -0700
committerAndreas Kling <kling@serenityos.org>2021-04-23 09:11:07 +0200
commit6c02ea39d1a7d0bbe82b0a013a81a7b239e42178 (patch)
treedd96b2c880a5a51dddc2bd8ef86da65574b3f064
parent4378d36f6701e0f4efe71ff1a301e3cd0776d5bf (diff)
downloadserenity-6c02ea39d1a7d0bbe82b0a013a81a7b239e42178.zip
LibM: Add more macros; increase precision of existing macros
-rw-r--r--Userland/Libraries/LibM/math.h42
1 files changed, 32 insertions, 10 deletions
diff --git a/Userland/Libraries/LibM/math.h b/Userland/Libraries/LibM/math.h
index 7b94470d87..4d2f02b539 100644
--- a/Userland/Libraries/LibM/math.h
+++ b/Userland/Libraries/LibM/math.h
@@ -28,16 +28,38 @@ __BEGIN_DECLS
#define INFINITY __builtin_huge_val()
#define NAN __builtin_nan("")
#define MAXFLOAT FLT_MAX
-#define M_E 2.718281828459045
-#define M_PI 3.141592653589793
-#define M_PI_2 1.570796326794896
-#define M_TAU 6.283185307179586
-#define M_DEG2RAD 0.017453292519943
-#define M_RAD2DEG 57.29577951308232
-#define M_LN2 0.69314718055995
-#define M_LN10 2.30258509299405
-#define M_SQRT2 1.4142135623730951
-#define M_SQRT1_2 0.7071067811865475
+
+#define M_E 2.7182818284590452354
+#define M_LOG2E 1.4426950408889634074
+#define M_LOG10E 0.43429448190325182765
+#define M_LN2 0.69314718055994530942
+#define M_LN10 2.30258509299404568402
+#define M_PI 3.14159265358979323846
+#define M_PI_2 1.57079632679489661923
+#define M_PI_4 0.78539816339744830962
+#define M_1_PI 0.31830988618379067154
+#define M_2_PI 0.63661977236758134308
+#define M_2_SQRTPI 1.12837916709551257390
+#define M_SQRT2 1.41421356237309504880
+#define M_SQRT1_2 0.70710678118654752440
+
+#define M_Ef32 2.7182818284590452354f
+#define M_LOG2Ef32 1.4426950408889634074f
+#define M_LOG10Ef32 0.43429448190325182765f
+#define M_LN2f32 0.69314718055994530942f
+#define M_LN10f32 2.30258509299404568402f
+#define M_PIf32 3.14159265358979323846f
+#define M_PI_2f32 1.57079632679489661923f
+#define M_PI_4f32 0.78539816339744830962f
+#define M_1_PIf32 0.31830988618379067154f
+#define M_2_PIf32 0.63661977236758134308f
+#define M_2_SQRTPIf32 1.12837916709551257390f
+#define M_SQRT2f32 1.41421356237309504880f
+#define M_SQRT1_2f32 0.70710678118654752440f
+
+#define M_TAU 6.28318530717958647692
+#define M_DEG2RAD 0.01745329251994329576
+#define M_RAD2DEG 57.2957795130823208767
#define FP_NAN 0
#define FP_INFINITE 1