**Subject:** Re: bc (1)

**To:** None *<current-users@NetBSD.ORG>*

**From:** Robert Black *<r.black@ic.ac.uk>*

**List:** current-users

**Date:** 06/21/1996 15:46:13
On Jun 21, 5:00am, John M Vinopal wrote:
> Subject: bc (1)
>
> does someone familiar with this utility know why it chooses to recode
> series approximations for sin(), cos(), atan() rather than calling the
> (hopefully) functional and accurate library ones?
AFAIK the reason it does it is accuracy :-) From the manual page for bc:
+ bc is a language that supports arbitrary precision numbers
+ with interactive execution of statements.
If you ask for sin() to 100 decimal places you get sin() to 100 decimal places.
Needless to say it can't do this using library calls.
> i was just grousing that it lacks acos() and asin(), and was slightly
> horrified to see what its doing.
The Windows 3.1 calculator uses library calls. Which would you rather trust?
Hmm, my memory is a bit rusty on this but isn't
asin(x) == atan(1/sqrt(1/(x * x) - 1))
and
acos(x) == atan(sqrt(1/(x * x) - 1))
or something like that. I'd check these if I were you before using them, I'm
only half awake right now.
Cheers
Rob Black
--