summaryrefslogtreecommitdiff
path: root/test/maceps.t.c
diff options
context:
space:
mode:
authorElizabeth Hunt <elizabeth.hunt@simponic.xyz>2023-10-18 12:49:39 -0600
committerElizabeth Hunt <elizabeth.hunt@simponic.xyz>2023-10-18 12:49:39 -0600
commit9e7166a52e94d8e15bf2dbfe00026f21f76630a9 (patch)
treebb4d7114d5f91fa128375347ab4249a4c35408f2 /test/maceps.t.c
parent1b4d91e623a083690ac6554d1aeaa38b75469908 (diff)
downloadcmath-9e7166a52e94d8e15bf2dbfe00026f21f76630a9.tar.gz
cmath-9e7166a52e94d8e15bf2dbfe00026f21f76630a9.zip
oct 16, 18 notes. add unit tests with utest, and bisection root finding methods
Diffstat (limited to 'test/maceps.t.c')
-rw-r--r--test/maceps.t.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/test/maceps.t.c b/test/maceps.t.c
new file mode 100644
index 0000000..9c45659
--- /dev/null
+++ b/test/maceps.t.c
@@ -0,0 +1,18 @@
+#include "lizfcm.test.h"
+#include <math.h>
+
+UTEST(maceps, smaceps) {
+ float epsilon = smaceps();
+ float one = 1.0;
+ float approx_one = one + epsilon;
+
+ EXPECT_LE(approx_one - one, 0);
+}
+
+UTEST(maceps, dmaceps) {
+ double epsilon = dmaceps();
+ double one = 1.0;
+ double approx_one = one + epsilon;
+
+ EXPECT_LE(approx_one - one, 0);
+}