summaryrefslogtreecommitdiff
path: root/userland/libc/math
diff options
context:
space:
mode:
authorAnton Kling <anton@kling.gg>2024-11-28 00:16:54 +0100
committerAnton Kling <anton@kling.gg>2024-11-28 00:16:54 +0100
commitfd685bad3b3835536c5b0f5b5b18f5ab13f32bf4 (patch)
treecc2d2300e9a2f47f4dfa55d2849b089328a367b1 /userland/libc/math
parent54869df7835565d0983096f65326cdd2d5f4f3d8 (diff)
add missing files
Diffstat (limited to 'userland/libc/math')
-rw-r--r--userland/libc/math/fmin.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/userland/libc/math/fmin.c b/userland/libc/math/fmin.c
new file mode 100644
index 0000000..b4aca16
--- /dev/null
+++ b/userland/libc/math/fmin.c
@@ -0,0 +1,14 @@
+#include <libc_test.h>
+#include <math.h>
+
+double fmin(double x, double y) {
+ if (x > y) {
+ return y;
+ }
+ return x;
+}
+
+LIBC_TEST(fmin, {
+ TEST_ASSERT(0 == fmin(1, 0));
+ TEST_ASSERT(0 == fmin(0, 1));
+})