Article View: comp.bugs.4bsd
Article #125a(x) of `bc -l' makes incorrect output.(4.3BSD)
From: Katsuhiro Watanabe
Date: Mon, 09 Oct 1989 11:25
Date: Mon, 09 Oct 1989 11:25
51 lines
1829 bytes
1829 bytes
Subject: a(x) of `bc -l' on 4.3BSD makes incorrect output.
Index: usr.lib/lib.b 4.3BSD
Description:
Function a(x) (arctan) of `bc -l' returns
0 (when x == 0)
.78539816339744830961 (when x != 0)
The bug is in `/usr/lib/lib.b'. It is working correctly on 4.2BSD,
but not on the 4.3BSD.
Repeat-By:
bc -l
a(0.00000001)
Fix:
Apply the following patch. (then you will get the same lib.b (4.2BSD)
as before. What the revision on 4.3BSD for?
To insert the Bug in it only! Absurd....)
-------------------------- CUT HERE -----------------------
*** lib.b.orig Tue Dec 6 19:27:41 1988
--- lib.b Mon Oct 9 11:49:08 1989
***************
*** 125,133 ****
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
f=1
while(x > .5){
--- 125,135 ----
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
f=1
while(x > .5){
-------------------------- CUT HERE -----------------------
----____----____
WATANABE Katsuhiro
Software Tools and Technology Division, SRA Inc. JAPAN.
Not execute f(x), but evaluate it.
Technical Details
Message-ID:
<2819@srava.sra.JUNET>Path:
arc1-ca.pugleaf.net!utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!wuarchive!wugate!uunet!kddlab!titcca!sragwa!sran124!srava!katsuShow Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!wuarchive!wugate!uunet!kddlab!titcca!sragwa!sran124!srava!katsu From: katsu@srava.sra.JUNET (Katsuhiro Watanabe) Newsgroups: comp.bugs.4bsd Subject: a(x) of `bc -l' makes incorrect output.(4.3BSD) Message-ID: <2819@srava.sra.JUNET> Date: 9 Oct 89 11:25:11 GMT Reply-To: katsu%sra.JUNET@uunet.UU.NET (Katsuhiro Watanabe) Organization: Software Research Associates, Inc., Japan Lines: 51 Xtranslator: Cheung Wah Kheang