summaryrefslogtreecommitdiffstats
path: root/gnu/usr.bin/dc
diff options
context:
space:
mode:
authorats <ats@FreeBSD.org>1994-12-03 16:32:02 +0000
committerats <ats@FreeBSD.org>1994-12-03 16:32:02 +0000
commite870c35b7e2bb76af3c3359e8af99b2b815702f1 (patch)
tree9865ff9a2b8a4cb420179d7515c23054699a7403 /gnu/usr.bin/dc
parent69bb6a6b4151e4bef856c06012668494ed89ad4d (diff)
downloadFreeBSD-src-e870c35b7e2bb76af3c3359e8af99b2b815702f1.zip
FreeBSD-src-e870c35b7e2bb76af3c3359e8af99b2b815702f1.tar.gz
Throw out the abort call, the reasoning seems to be false :-).
Change a round to a truncate. Problem reported from Christoph Kukulies: 9.8 2 / p did an IOT trap. There is one remaining problem.: 9.8 2 % p shows on other machines 1.8 but does here in the moment 1.
Diffstat (limited to 'gnu/usr.bin/dc')
-rw-r--r--gnu/usr.bin/dc/decimal.c6
-rw-r--r--gnu/usr.bin/dc/decimal.h2
2 files changed, 4 insertions, 4 deletions
diff --git a/gnu/usr.bin/dc/decimal.c b/gnu/usr.bin/dc/decimal.c
index 1fb95c1..24f59ef 100644
--- a/gnu/usr.bin/dc/decimal.c
+++ b/gnu/usr.bin/dc/decimal.c
@@ -119,7 +119,7 @@ decimal_copy_1 (b, digits)
return result;
}
else
- return decimal_round_digits (b, digits);
+ return decimal_trunc_digits (b, digits);
}
/* flush specified number `digits' of trailing fraction digits,
@@ -858,8 +858,8 @@ decimal_div (b1, b2, digits)
return decimal_copy (DECIMAL_ZERO);
}
- if (lengthr <= (length1 - length2))
- abort(); /* My reasoning says this cannot happen, I hope */
+/* if (lengthr <= (length1 - length2))
+ abort(); */ /* My reasoning says this cannot happen, I hope */
for (i = length1 - length2; i >= 0; i--)
{
diff --git a/gnu/usr.bin/dc/decimal.h b/gnu/usr.bin/dc/decimal.h
index 2b41158..49f749d 100644
--- a/gnu/usr.bin/dc/decimal.h
+++ b/gnu/usr.bin/dc/decimal.h
@@ -84,7 +84,7 @@ typedef struct decimal *decimal;
decimal decimal_add (), decimal_sub (), decimal_mul (), decimal_div ();
decimal decimal_mul_dc (), decimal_mul_rounded (), decimal_rem ();
-decimal decimal_round_digits ();
+decimal decimal_round_digits (), decimal_trunc_digits ();
decimal make_decimal (), decimal_copy (), decimal_parse ();
decimal decimal_sqrt (), decimal_expt ();
OpenPOWER on IntegriCloud