From 8e30a6b447ce0cea8d65b941496193cc6ca1d3c8 Mon Sep 17 00:00:00 2001 From: Kevin Lo Date: Sun, 18 Mar 2012 15:34:39 +0000 Subject: [PATCH] Repair function when used with large scales Submitted by: AIDA Shinra --- usr.bin/bc/bc.library | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/usr.bin/bc/bc.library b/usr.bin/bc/bc.library index d0b3df86867..7f4a93e2236 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