Prehistoric BC Bug - (nf)
Robert Herndon
herndon at umn-cs.UUCP
Wed Feb 1 12:00:53 AEST 1984
#N:umn-cs:1300001:000:745
umn-cs!herndon Jan 31 17:59:00 1984
There is a bug in the BC library. The arc-tangent function ("a")
returns pi/4 for the arctangent of any non-zero number. The cause
of this is a mis-associated "if" statement in the function definition.
The fix for this is to change the definition of the a() function.
The file currently reads:
125a126,128
> if(x==1)
> if(scale<52)
> return(.7853981633974483096156608458198757210492923498437764/1)
The following may be substituted:
126,130d125
> if(x==1) {
> if(scale<52) {
> return(.7853981633974483096156608458198757210492923498437764/1)
> }
> }
Or the lines may be deleted entirely. This will slow down the
evaluation of a(1) substantially but will not otherwise harm the
function.
Robert Herndon
umn-cs!herndon
More information about the Net.bugs
mailing list