summaryrefslogtreecommitdiffstatshomepage
path: root/lib/libm/math.c
diff options
context:
space:
mode:
authorDamien George <damien.p.george@gmail.com>2018-09-27 15:21:04 +1000
committerDamien George <damien.p.george@gmail.com>2018-09-27 15:21:04 +1000
commit8960a2823800c4b699d319e63b7472b3628d7344 (patch)
treeb0cc87a3913b04ffd10aab6b6fc2403b850ca311 /lib/libm/math.c
parent4c08932e735e7b75f3cdd3e0931443c088e6fd68 (diff)
downloadmicropython-8960a2823800c4b699d319e63b7472b3628d7344.tar.gz
micropython-8960a2823800c4b699d319e63b7472b3628d7344.zip
lib/libm/math: Add implementation of __signbitf, if needed by a port.
Diffstat (limited to 'lib/libm/math.c')
-rw-r--r--lib/libm/math.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/libm/math.c b/lib/libm/math.c
index 1bfa5fe93c..c23b9f8d36 100644
--- a/lib/libm/math.c
+++ b/lib/libm/math.c
@@ -36,6 +36,11 @@ typedef union {
};
} float_s_t;
+int __signbitf(float f) {
+ float_s_t u = {.f = f};
+ return u.s;
+}
+
#ifndef NDEBUG
float copysignf(float x, float y) {
float_s_t fx={.f = x};