summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDamien George <damien.p.george@gmail.com>2014-07-01 14:03:55 +0100
committerDamien George <damien.p.george@gmail.com>2014-07-01 14:03:55 +0100
commitaa47f3968bdb46c67b6150eb7637d1cbd1e76767 (patch)
tree9ce1fe32b19d5fa0b851b11bf4ec30956d0a9a65
parentcaa7334141e6d67ab6f3064b250e6729095ae56c (diff)
parent5d44e6a92ca6d371304c89f25add385d9777ebca (diff)
Merge pull request #734 from iabdalkader/copysign
Add copysignf
-rw-r--r--stmhal/math.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/stmhal/math.c b/stmhal/math.c
index 637f447cf..91ffb2503 100644
--- a/stmhal/math.c
+++ b/stmhal/math.c
@@ -72,6 +72,7 @@ float __attribute__((pcs("aapcs"))) __aeabi_d2f(double x) {
fx.m = (dx.m>>(52-23)); // right justify
return fx.f;
}
+
double __aeabi_dmul(double x , double y) {
return 0.0;
@@ -85,6 +86,18 @@ float sqrtf(float x) {
return x;
}
+#ifndef NDEBUG
+float copysignf(float x, float y) {
+ float_s_t fx={.f = x};
+ float_s_t fy={.f = y};
+
+ // copy sign bit;
+ fx.s = fy.s;
+
+ return fx.f;
+}
+#endif
+
// some compilers define log2f in terms of logf
#ifdef log2f
#undef log2f