summaryrefslogtreecommitdiffstats
path: root/usr.bin/bc
diff options
context:
space:
mode:
authorkevlo <kevlo@FreeBSD.org>2012-03-18 15:34:39 +0000
committerkevlo <kevlo@FreeBSD.org>2012-03-18 15:34:39 +0000
commit5eef7eb9a7305d806d3c7dd1aa25f326683be0fe (patch)
tree0a59b17462b8aeac6f6dc91298192cddb907ad19 /usr.bin/bc
parentfcd574676ff38d18f42539cb9e99901b4679eaa2 (diff)
downloadFreeBSD-src-5eef7eb9a7305d806d3c7dd1aa25f326683be0fe.zip
FreeBSD-src-5eef7eb9a7305d806d3c7dd1aa25f326683be0fe.tar.gz
Repair function when used with large scales
Submitted by: AIDA Shinra <shinra at j10n dot org>
Diffstat (limited to 'usr.bin/bc')
-rw-r--r--usr.bin/bc/bc.library5
1 files changed, 3 insertions, 2 deletions
diff --git a/usr.bin/bc/bc.library b/usr.bin/bc/bc.library
index d0b3df8..7f4a93e 100644
--- a/usr.bin/bc/bc.library
+++ b/usr.bin/bc/bc.library
@@ -48,7 +48,7 @@ define e(x) {
t = scale
scale = 0
if (x > 0) scale = (0.435*x)/1
- scale = scale + t + 1
+ scale = scale + t + length(scale + t) + 1
w = 0
if (x < 0) {
@@ -120,7 +120,8 @@ define l(x) {
f = f*2
}
- scale = t + length(f) + length(t + length(f)) + 1
+ scale = 0
+ scale = t + length(f) + length((1.05*(t+length(f))/1)) + 1
u = (x - 1)/(x + 1)
s = u*u
scale = t + 2
OpenPOWER on IntegriCloud