[net.wanted.sources] wanted: simple, user-friendly UNIX calculator

dave@lsuc.UUCP (David Sherman) (02/19/85)

We teach a course in Canadian income tax on our UNIX system,
and students need access to an on-line calculator. Right now
I invoke "bc" when they request a calculator, but it's far from
ideal. I have to give several lines of instructions, like "use '*'
for multiplication", and "do not type the equals sign". Of course,
	2+2=
produces
	syntax error on line , teletype

which is hardly what I want to inflict on law students who are
dealing with what is otherwise an extremely user-cuddly system.

So, I'd like a calculator which will:
	- do simple arithmetic, no variables
	- accept (but not require) a '=' on the line
	- allow 'x' or 'X' as well as '*' for multiplication
	- handle '%' and () bracketing if possible (not crucial)
	- produce floating-point when needed after division, not truncate

If no-one has one like this, I guess I'll work from Kernighan & Pike
and construct one using lex & yacc. But I really don't have the time.
-- 
{utzoo pesnta nrcaero utcs hcr}!lsuc!dave
{allegra decvax ihnp4 linus}!utcsri!lsuc!dave

rpw3@redwood.UUCP (Rob Warnock) (02/20/85)

+---------------
| ... students need access to an on-line calculator. Right now
| I invoke "bc" when they request a calculator, but it's far from
| ideal...  So, I'd like a calculator which will: [...list of features...]
| If no-one has one like this, I guess I'll work from Kernighan & Pike
| and construct one using lex & yacc. But I really don't have the time.
| 	{utzoo pesnta nrcaero utcs hcr}!lsuc!dave
| 	{allegra decvax ihnp4 linus}!utcsri!lsuc!dave
+---------------

K & P's "hoc6" was posted to net.sources last June (1984) by <nlm-vax!lef>
(by permission from Prentice-Hall). Check your local/nearby net.sources
archives. <nlm-vax!lef> posted one followup bug fix, which I include in
case the archive doesn't have it:

	The fourth line (#define code3...) should be
	appended by the following text:
		; code (c3)

I compiled it (with the above fix) and it seemed to work just fine.


Rob Warnock
Systems Architecture Consultant

UUCP:	{ihnp4,ucbvax!dual}!fortune!redwood!rpw3
DDD:	(415)572-2607
USPS:	510 Trinidad Lane, Foster City, CA  94404

dave@lsuc.UUCP (David Sherman) (02/20/85)

In article <167@redwood.UUCP> rpw3@redwood.UUCP (Rob Warnock) writes:
||+---------------
||| ... students need access to an on-line calculator. Right now
||| I invoke "bc" when they request a calculator, but it's far from
||| ideal...  So, I'd like a calculator which will: [...list of features...]
||| If no-one has one like this, I guess I'll work from Kernighan & Pike
||| and construct one using lex & yacc. But I really don't have the time.
|||  Dave Sherman
||+---------------
||
||K & P's "hoc6" was posted to net.sources last June (1984) by <nlm-vax!lef>
||(by permission from Prentice-Hall). Check your local/nearby net.sources
||archives...

I thought I made that clear with my original posting. hoc6
isn't what I want either, but if I have to I can go back and
build what I need by following the hoc creation. I don't want
variables. I just want exactly what you get when you use a
dummy physical $5 calculator. That's something law students can
understand. I have hoc6 running here, and if I type
	2+2=
I get
	hoc: syntax error near line 1

I'm sure putting in code to ignore an '=' isn't hard, but that's
just one of the things which need doing to make it usable by *anyone*.

Dave Sherman
-- 
{utzoo pesnta nrcaero utcs hcr}!lsuc!dave
{allegra decvax ihnp4 linus}!utcsri!lsuc!dave

jsdy@hadron.UUCP (Joseph S. D. Yao) (02/22/85)

> So, I'd like a calculator which will:
> 	- do simple arithmetic, no variables
> 	- accept (but not require) a '=' on the line
> 	- allow 'x' or 'X' as well as '*' for multiplication
> 	- handle '%' and () bracketing if possible (not crucial)
> 	- produce floating-point when needed after division, not truncate
It's gross overkill, but the only package I know of that does all
that is MACSYMA / VAXSYMA, and I don't know offhand where or how
to get a copy.  Anybody?  ;-)

Joe Yao		hadron!jsdy@seismo.{ARPA,UUCP}