diff options
Diffstat (limited to 'zap/source/any/math/exp.c')
-rw-r--r-- | zap/source/any/math/exp.c | 5 |
1 files changed, 4 insertions, 1 deletions
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; \ |