summaryrefslogtreecommitdiff
path: root/zap/source/any/math
diff options
context:
space:
mode:
Diffstat (limited to 'zap/source/any/math')
-rw-r--r--zap/source/any/math/div0.c9
-rw-r--r--zap/source/any/math/exp.c5
2 files changed, 4 insertions, 10 deletions
diff --git a/zap/source/any/math/div0.c b/zap/source/any/math/div0.c
index 87fcfa0..07c15a4 100644
--- a/zap/source/any/math/div0.c
+++ b/zap/source/any/math/div0.c
@@ -8,15 +8,6 @@
#include <csys.h>
-#if csys_os_linux
-#include <asm/unistd.h>
-#endif
-
zap_i04 zap_priv_div0(void) {
-#if defined(zap_priv_signaldiv0)
-#if csys_os_linux
- csys_syscall(__NR_kill,csys_syscall(__NR_getpid),0x8u);
-#endif
-#endif
return (zap_i04)-0x1;
}
diff --git a/zap/source/any/math/exp.c b/zap/source/any/math/exp.c
index 6c16213..bf0869d 100644
--- a/zap/source/any/math/exp.c
+++ b/zap/source/any/math/exp.c
@@ -8,9 +8,12 @@
#define zap_priv_exp(_wdth) \
zap_i##_wdth zap_exp##_wdth(zap_i##_wdth const _val,zap_i##_wdth const _n) { \
- if (_val == 0x0) { \
+ if (__builtin_expect(_n == 0x0u,0x0)) { \
return 0x1u; \
} \
+ if (__builtin_expect(_val == 0x0u,0x0)) { \
+ return 0x0u; \
+ } \
zap_i##_wdth val = _val; \
for (zap_i##_wdth i = 0x1u;i < _n;++i) { \
val *= _val; \