🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.bugs.4bsd
Article #1245

Bc Math Library Bug (+Fix)

#1245
From: Steve Lademann
Date: Fri, 11 Nov 1988 10:13
43 lines
1713 bytes
Description: The `a' function (arctangent) of the math library for
             bc supplied with 4.3BSD doesn't work properly.

Repeat by:   Run bc with the libaray switch (`bc -l') and try any argument
             to the `a' function. It always gives the same result! e.g.

             a(1)
             .7853981633...
             a(.2)
             .7853981633...

Fix:         Apply the following patch to the library /usr/lib/lib.b and
             /usr/src/usr.lib/lib.b

*** /usr/lib/lib.b.old	Fri Nov 11 09:52:20 1988
--- /usr/lib/lib.b	Fri Nov 11 09:53:55 1988
***************
*** 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,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){


Steve Lademann          |Phone: 44 727 59292 x4326
Marconi Instruments Ltd |UUCP : ...mcvax!ukc!hrc63!miduet!steve
St. Albans    AL4 0JN   |     : ...mcvax!ukc!root44!miduet!steve
Herts.   UK             |NRS  : steve@uk.co.gec-mi-at
Technical Details
Message-ID: <1042@gec-mi-at.co.uk>
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!mcvax!ukc!stc!root44!miduet!steve

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!mcvax!ukc!stc!root44!miduet!steve
From: steve@gec-mi-at.co.uk (Steve Lademann)
Newsgroups: comp.bugs.4bsd,eunet.bugs.4bsd
Subject: Bc Math Library Bug (+Fix)
Message-ID: <1042@gec-mi-at.co.uk>
Date: 11 Nov 88 10:13:22 GMT
Sender: news@gec-mi-at.co.uk
Reply-To: steve@gec-mi-at.co.uk (Steve Lademann)
Organization: Marconi Instruments Ltd., St. Albans, UK
Lines: 43