[comp.unix.questions] Beyond BC Available?

reid@cpswh.cps.msu.edu (Dr Richard J. Reid) (03/25/90)

Is there a follow-on to BC (circa 1978) available under UNIX?

A more complete interactive C, that is?

Thanks for any help.

Dick

gwyn@smoke.BRL.MIL (Doug Gwyn) (03/25/90)

In article <7009@cps3xx.UUCP> reid@cpswh.cps.msu.edu (Dr Richard J. Reid) writes:
>Is there a follow-on to BC (circa 1978) available under UNIX?
>A more complete interactive C, that is?

If ordinary double-precision is sufficient for your needs,
then I recommend Kernighan & Pike's "hoc" which is described in their
book "The UNIX Programming Environment".  If you don't want to type in
all that code, I've done so (in fact later diffed it against Kernighan's
actual sources to catch any typos) and can mail you a copy.  However, be
sure to buy the book anyway; it's a classic!

tchrist@convex.COM (Tom Christiansen) (03/25/90)

>Is there a follow-on to BC (circa 1978) available under UNIX?
>A more complete interactive C, that is?

I'm not sure that a follow-on BC would be interactive C, but if you're
not looking for infinite precision arithmetic, you could look at perl.

C with built-in sed commands and awk associative arrays
, with extensive access to system calls, even networking.  For interactive 
applications, you can use the perl debugger.

Perl has a fairly complete math package that's adequate for
non-numerically intensive applications.  Values are stored as doubles
and functions available are atan2, cos, exp, int, log (natural), rand,
sin, sqrt, and srand.  It has the full set of C operators, plus a few
more, including ** (and the corresponding **=) for exponentiation.

Perl is available from your favorite comp.sources.unix archive servers,
and there's a newsgroup (comp.lang.perl) devoted to it.

--tom
--

    Tom Christiansen                       {uunet,uiucdcs,sun}!convex!tchrist 
    Convex Computer Corporation                            tchrist@convex.COM
		 "EMACS belongs in <sys/errno.h>: Editor too big!"