aboutsummaryrefslogtreecommitdiffstats
path: root/mpfr.c
diff options
context:
space:
mode:
authorArnold D. Robbins <arnold@skeeve.com>2016-10-25 21:41:43 +0300
committerArnold D. Robbins <arnold@skeeve.com>2016-10-25 21:41:43 +0300
commita6852e4b9f87885fb2ee1285f18343b4bdbc91e3 (patch)
treef4502349ded0d6d0f609b3154de1bcec16d9b476 /mpfr.c
parentb4f33f6a4588ad62b4cffa05f81ba31ed224bd0d (diff)
parent8231da563c810ce210ce309ee1a022bad22a1e13 (diff)
downloadegawk-a6852e4b9f87885fb2ee1285f18343b4bdbc91e3.tar.gz
egawk-a6852e4b9f87885fb2ee1285f18343b4bdbc91e3.tar.bz2
egawk-a6852e4b9f87885fb2ee1285f18343b4bdbc91e3.zip
Merge branch 'master' into feature/typed-regex
Diffstat (limited to 'mpfr.c')
-rw-r--r--mpfr.c33
1 files changed, 15 insertions, 18 deletions
diff --git a/mpfr.c b/mpfr.c
index c3795d21..cdcc9bb2 100644
--- a/mpfr.c
+++ b/mpfr.c
@@ -813,11 +813,11 @@ do_mpfr_compl(int nargs)
/* [+-]inf or NaN */
return tmp;
}
- if (do_lint) {
- if (mpfr_sgn(p) < 0)
- lintwarn("%s",
- mpg_fmt(_("compl(%Rg): negative value will give strange results"), p)
+ if (mpfr_sgn(p) < 0)
+ fatal("%s",
+ mpg_fmt(_("compl(%Rg): negative value is not allowed"), p)
);
+ if (do_lint) {
if (! mpfr_integer_p(p))
lintwarn("%s",
mpg_fmt(_("comp(%Rg): fractional value will be truncated"), p)
@@ -829,12 +829,10 @@ do_mpfr_compl(int nargs)
} else {
/* (tmp->flags & MPZN) != 0 */
zptr = tmp->mpg_i;
- if (do_lint) {
- if (mpz_sgn(zptr) < 0)
- lintwarn("%s",
- mpg_fmt(_("cmpl(%Zd): negative values will give strange results"), zptr)
+ if (mpz_sgn(zptr) < 0)
+ fatal("%s",
+ mpg_fmt(_("compl(%Zd): negative values is not allowed"), zptr)
);
- }
}
r = mpg_integer();
@@ -870,13 +868,13 @@ get_intval(NODE *t1, int argnum, const char *op)
return pz; /* should be freed */
}
- if (do_lint) {
- if (mpfr_sgn(left) < 0)
- lintwarn("%s",
- mpg_fmt(_("%s: argument #%d negative value %Rg will give strange results"),
+ if (mpfr_sgn(left) < 0)
+ fatal("%s",
+ mpg_fmt(_("%s: argument #%d negative value %Rg is not allowed"),
op, argnum, left)
);
+ if (do_lint) {
if (! mpfr_integer_p(left))
lintwarn("%s",
mpg_fmt(_("%s: argument #%d fractional value %Rg will be truncated"),
@@ -891,13 +889,12 @@ get_intval(NODE *t1, int argnum, const char *op)
}
/* (t1->flags & MPZN) != 0 */
pz = t1->mpg_i;
- if (do_lint) {
- if (mpz_sgn(pz) < 0)
- lintwarn("%s",
- mpg_fmt(_("%s: argument #%d negative value %Zd will give strange results"),
+ if (mpz_sgn(pz) < 0)
+ fatal("%s",
+ mpg_fmt(_("%s: argument #%d negative value %Zd is not allowed"),
op, argnum, pz)
);
- }
+
return pz; /* must not be freed */
}