Here's a complete diff. Not that it is relative the whitespace cleanup
diff I comitted a few hours ago. So make sure your tree is up-to-date
before patching.
-Otto
Index: bc.library
===================================================================
RCS file: /cvs/src/usr.bin/bc/bc.library,v
retrieving revision 1.2
diff -u -p -r1.2 bc.library
--- bc.library 29 Jan 2007 11:02:53 -0000 1.2
+++ bc.library 29 Jan 2007 12:37:14 -0000
@@ -40,8 +40,10 @@
scale = 20
define e(x) {
- auto a, b, c, d, e, g, t, w, y
+ auto a, b, c, d, e, g, t, w, y, r
+ r = ibase
+ ibase = A
t = scale
scale = t + .434*x + 1
@@ -72,16 +74,23 @@ define e(x) {
g = g*g
}
scale = t
- if (w == 1) return(1/g)
- return(g/1)
+ ibase = r
+ if (w == 1) return (1/g)
+ return (g/1)
}
e = g
}
}
define l(x) {
- auto a, b, c, d, e, f, g, u, s, t
- if (x <= 0) return (1 - 10^scale)
+ auto a, b, c, d, e, f, g, u, s, t, r
+ r = ibase
+ ibase = A
+ if (x <= 0) {
+ a = (1 - 10^scale)
+ ibase = r
+ return (a)
+ }
t = scale
f = 1
@@ -116,6 +125,7 @@ define l(x) {
g = c/d
if (g == e) {
scale = t
+ ibase = r
return (u*c/d)
}
e = g
@@ -123,7 +133,9 @@ define l(x) {
}
define s(x) {
- auto a, b, c, s, t, y, p, n, i
+ auto a, b, c, s, t, y, p, n, i, r
+ r = ibase
+ ibase = A
t = scale
y = x/.7853
s = t + length(y) - scale(y)
@@ -148,6 +160,7 @@ define s(x) {
c = a/b
if (c == 0) {
scale = t
+ ibase = r
return (s/1)
}
s = s + c
@@ -155,20 +168,28 @@ define s(x) {
}
define c(x) {
- auto t
+ auto t, r
+ r = ibase
+ ibase = A
t = scale
scale = scale + 1
x = s(x + 2*a(1))
scale = t
+ ibase = r
return (x/1)
}
define a(x) {
- auto a, b, c, d, e, f, g, s, t
+ auto a, b, c, d, e, f, g, s, t, r
if (x == 0) return(0)
+
+ r = ibase
+ ibase = A
if (x == 1) {
if (scale < 52) {
-
return(.7853981633974483096156608458198757210492923498437764/1)
+ a =
.7853981633974483096156608458198757210492923498437764/1
+ ibase = r
+ return (a)
}
}
t = scale
@@ -194,6 +215,7 @@ define a(x) {
d = d*a
g = c/d
if (g == e) {
+ ibase = r
scale = t
return (x*c/d)
}
@@ -202,8 +224,10 @@ define a(x) {
}
define j(n,x) {
- auto a,b,c,d,e,g,i,s,k,t
+ auto a, b, c, d, e, g, i, s, k, t, r
+ r = ibase
+ ibase = A
t = scale
k = 1.36*x + 1.16*t - n
k = length(k) - scale(k)
@@ -229,6 +253,7 @@ define j(n,x) {
c = c*i*(n + i)
g = b/c
if (g == e) {
+ ibase = r
scale = t
return (g/1)
}