=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/bc/bc.library,v retrieving revision 1.2 retrieving revision 1.3 diff -c -r1.2 -r1.3 *** src/usr.bin/bc/bc.library 2007/01/29 11:02:53 1.2 --- src/usr.bin/bc/bc.library 2007/02/03 21:15:06 1.3 *************** *** 1,4 **** ! /* $OpenBSD: bc.library,v 1.2 2007/01/29 11:02:53 otto Exp $ */ /* * Copyright (C) Caldera International Inc. 2001-2002. --- 1,4 ---- ! /* $OpenBSD: bc.library,v 1.3 2007/02/03 21:15:06 otto Exp $ */ /* * Copyright (C) Caldera International Inc. 2001-2002. *************** *** 40,47 **** scale = 20 define e(x) { ! auto a, b, c, d, e, g, t, w, y t = scale scale = t + .434*x + 1 --- 40,49 ---- scale = 20 define e(x) { ! auto a, b, c, d, e, g, t, w, y, r + r = ibase + ibase = A t = scale scale = t + .434*x + 1 *************** *** 72,87 **** g = g*g } scale = t ! 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) t = scale f = 1 --- 74,96 ---- g = g*g } scale = t ! 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, r ! r = ibase ! ibase = A ! if (x <= 0) { ! a = (1 - 10^scale) ! ibase = r ! return (a) ! } t = scale f = 1 *************** *** 116,121 **** --- 125,131 ---- g = c/d if (g == e) { scale = t + ibase = r return (u*c/d) } e = g *************** *** 123,129 **** } define s(x) { ! auto a, b, c, s, t, y, p, n, i t = scale y = x/.7853 s = t + length(y) - scale(y) --- 133,141 ---- } define s(x) { ! 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,153 **** --- 160,166 ---- c = a/b if (c == 0) { scale = t + ibase = r return (s/1) } s = s + c *************** *** 155,174 **** } define c(x) { ! auto t t = scale scale = scale + 1 x = s(x + 2*a(1)) scale = t return (x/1) } define a(x) { ! auto a, b, c, d, e, f, g, s, t if (x == 0) return(0) if (x == 1) { if (scale < 52) { ! return(.7853981633974483096156608458198757210492923498437764/1) } } t = scale --- 168,195 ---- } define c(x) { ! 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, r if (x == 0) return(0) + + r = ibase + ibase = A if (x == 1) { if (scale < 52) { ! a = .7853981633974483096156608458198757210492923498437764/1 ! ibase = r ! return (a) } } t = scale *************** *** 194,199 **** --- 215,221 ---- d = d*a g = c/d if (g == e) { + ibase = r scale = t return (x*c/d) } *************** *** 202,209 **** } define j(n,x) { ! auto a,b,c,d,e,g,i,s,k,t t = scale k = 1.36*x + 1.16*t - n k = length(k) - scale(k) --- 224,233 ---- } define j(n,x) { ! 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,234 **** --- 253,259 ---- c = c*i*(n + i) g = b/c if (g == e) { + ibase = r scale = t return (g/1) }