aboutsummaryrefslogtreecommitdiffstats
path: root/src/zpow.c
diff options
context:
space:
mode:
authorMattias Andrée <maandree@kth.se>2016-03-04 23:50:00 +0100
committerMattias Andrée <maandree@kth.se>2016-03-04 23:50:00 +0100
commit76d0af5599554d11f104d582cdac8fbaa8569fcc (patch)
tree0ed9889a86d52ebd208382f2fd49dad0570d1f8c /src/zpow.c
parentClean up, fix a few bugs, and add a test (diff)
downloadlibzahl-76d0af5599554d11f104d582cdac8fbaa8569fcc.tar.gz
libzahl-76d0af5599554d11f104d582cdac8fbaa8569fcc.tar.bz2
libzahl-76d0af5599554d11f104d582cdac8fbaa8569fcc.tar.xz
Clean up, add zerror and zperror, fix bugs and add more tests
Signed-off-by: Mattias Andrée <maandree@kth.se>
Diffstat (limited to 'src/zpow.c')
-rw-r--r--src/zpow.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/src/zpow.c b/src/zpow.c
index c064f60..7388bde 100644
--- a/src/zpow.c
+++ b/src/zpow.c
@@ -13,14 +13,11 @@ zpow(z_t a, z_t b, z_t c)
if (zsignum(c) <= 0) {
if (zzero(c)) {
- if (zzero(b)) {
- errno = EDOM; /* Indeterminate form: 0:th power of 0 */
- FAILURE_JUMP();
- }
+ if (zzero(b))
+ FAILURE(EDOM); /* Indeterminate form: 0:th power of 0 */
zsetu(a, 1);
} else if (zzero(b)) {
- errno = EDOM; /* Undefined form: Division by 0 */
- FAILURE_JUMP();
+ FAILURE(EDOM); /* Undefined form: Division by 0 */
} else {
SET_SIGNUM(a, 0);
}