diff --git a/tests/expected/math.stdout b/tests/expected/math.stdout index 8654177967d9231f351bc0c74668c138a6acf838..e0e3e365ba4e973ebcf4ba6b65faaf88aa8c1563 100644 --- a/tests/expected/math.stdout +++ b/tests/expected/math.stdout @@ -1 +1,14 @@ +M_E = 2.7183 +M_LOG2E = 1.4427 +M_LOG10E = 0.4343 +M_LN2 = 0.6931 +M_LN10 = 2.3026 +M_PI = 3.1416 +M_PI_2 = 1.5708 +M_PI_4 = 0.7854 +M_1_PI = 0.3183 +M_2_PI = 0.6366 +M_2_SQRTPI = 1.1284 +M_SQRT2 = 1.4142 +M_SQRT1_2 = 0.7071 cos(3.140000) = -0.999999 diff --git a/tests/math.c b/tests/math.c index fb53fa2438dbff7a1e3b392b9ff8bda42928fe75..c30c553dfcf2ece0291a707128715754bf237829 100644 --- a/tests/math.c +++ b/tests/math.c @@ -2,6 +2,21 @@ #include int main(int argc, char ** argv) { + // Check the existence of math constants + printf("M_E = %.4f\n", M_E); + printf("M_LOG2E = %.4f\n", M_LOG2E); + printf("M_LOG10E = %.4f\n", M_LOG10E); + printf("M_LN2 = %.4f\n", M_LN2); + printf("M_LN10 = %.4f\n", M_LN10); + printf("M_PI = %.4f\n", M_PI); + printf("M_PI_2 = %.4f\n", M_PI_2); + printf("M_PI_4 = %.4f\n", M_PI_4); + printf("M_1_PI = %.4f\n", M_1_PI); + printf("M_2_PI = %.4f\n", M_2_PI); + printf("M_2_SQRTPI = %.4f\n", M_2_SQRTPI); + printf("M_SQRT2 = %.4f\n", M_SQRT2); + printf("M_SQRT1_2 = %.4f\n", M_SQRT1_2); + double pi = 3.14; float c = cos(pi); printf("cos(%f) = %f\n", pi, c);