svn commit: r233121 - head/usr.bin/bc
Kevin Lo
kevlo at FreeBSD.org
Sun Mar 18 15:34:39 UTC 2012
Author: kevlo
Date: Sun Mar 18 15:34:39 2012
New Revision: 233121
URL: http://svn.freebsd.org/changeset/base/233121
Log:
Repair function when used with large scales
Submitted by: AIDA Shinra <shinra at j10n dot org>
Modified:
head/usr.bin/bc/bc.library
Modified: head/usr.bin/bc/bc.library
==============================================================================
--- head/usr.bin/bc/bc.library Sun Mar 18 15:03:02 2012 (r233120)
+++ head/usr.bin/bc/bc.library Sun Mar 18 15:34:39 2012 (r233121)
@@ -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
More information about the svn-src-head
mailing list