summaryrefslogtreecommitdiff
path: root/pow.c
diff options
context:
space:
mode:
authorpelissip <pelissip@280ebfd0-de03-0410-8827-d642c229c3f4>2003-11-19 10:01:34 +0000
committerpelissip <pelissip@280ebfd0-de03-0410-8827-d642c229c3f4>2003-11-19 10:01:34 +0000
commit185dd575ae55b859e07c0ef7765cc0afd258079a (patch)
tree1921ab7720919687df9d25c74fe543555079eff1 /pow.c
parentafa09509c72f5158b2e2f8823f999d0a370f869d (diff)
downloadmpfr-185dd575ae55b859e07c0ef7765cc0afd258079a.tar.gz
Optimization of mpfr_mul.
Tiny optimization of mpfr_pow (The case y=0 has been put inside the MPFR_ARE_SINGULAR block). Tiny optimisation of mpfr_set_ui. git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@2554 280ebfd0-de03-0410-8827-d642c229c3f4
Diffstat (limited to 'pow.c')
-rw-r--r--pow.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/pow.c b/pow.c
index d12f4331e..ef84ff760 100644
--- a/pow.c
+++ b/pow.c
@@ -149,13 +149,12 @@ mpfr_pow (mpfr_ptr z, mpfr_srcptr x, mpfr_srcptr y, mp_rnd_t rnd_mode)
{
int inexact = 1;
- /* pow(x, ±0) returns 1 for any x, even a NaN. */
- if (MPFR_UNLIKELY( MPFR_IS_ZERO(y) ))
- return mpfr_set_ui (z, 1, GMP_RNDN);
-
if (MPFR_ARE_SINGULAR(x,y))
{
- if (MPFR_IS_NAN(x))
+ /* pow(x, 0) returns 1 for any x, even a NaN. */
+ if (MPFR_UNLIKELY( MPFR_IS_ZERO(y) ))
+ return mpfr_set_ui (z, 1, GMP_RNDN);
+ else if (MPFR_IS_NAN(x))
{
MPFR_SET_NAN(z);
MPFR_RET_NAN;