summaryrefslogtreecommitdiff
path: root/mpz/ui_pow_ui.c
diff options
context:
space:
mode:
authortege <tege@gmplib.org>1996-06-06 19:48:37 +0200
committertege <tege@gmplib.org>1996-06-06 19:48:37 +0200
commiteea0c6eba5d7bdbce755cfec9dc90c7310c5cafe (patch)
tree73488880589e6c7485520f77f3f89cd789a0de58 /mpz/ui_pow_ui.c
parentbf48ab352658222a2fa4201332dc00e97ba979fa (diff)
downloadgmp-eea0c6eba5d7bdbce755cfec9dc90c7310c5cafe.tar.gz
Swap tests for (e == 0) and (blimb == 0).
(This changes the result of 0^0 from 0 to 1.)
Diffstat (limited to 'mpz/ui_pow_ui.c')
-rw-r--r--mpz/ui_pow_ui.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/mpz/ui_pow_ui.c b/mpz/ui_pow_ui.c
index 617d85dfa..19baca14b 100644
--- a/mpz/ui_pow_ui.c
+++ b/mpz/ui_pow_ui.c
@@ -41,17 +41,17 @@ mpz_ui_pow_ui (r, b, e)
/* Single out cases that give result == 0 or 1. These tests are here
to simplify the general code below, not to optimize. */
- if (blimb == 0)
- {
- r->_mp_size = 0;
- return;
- }
if (e == 0)
{
r->_mp_d[0] = 1;
r->_mp_size = 1;
return;
}
+ if (blimb == 0)
+ {
+ r->_mp_size = 0;
+ return;
+ }
if (blimb < 0x100)
{