Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/5/84; site wivax.UUCP Path: utzoo!watmath!clyde!cbosgd!ihnp4!zehntel!hplabs!pesnta!amdcad!decwrl!decvax!wivax!perlman From: perlman@wivax.UUCP (Gary Perlman) Newsgroups: net.unix,net.lang Subject: Re: A desk calculator with formula definition Message-ID: <20348@wivax.UUCP> Date: Sun, 9-Dec-84 12:00:21 EST Article-I.D.: wivax.20348 Posted: Sun Dec 9 12:00:21 1984 Date-Received: Tue, 11-Dec-84 05:02:31 EST References: <1245@ihuxr.UUCP> Organization: Wang Institute, Tyngsboro, MA 01879 USA Lines: 30 Xref: watmath net.unix:3081 net.lang:1128 UNIX|STAT, my public domain stat packagge has a similar calculator. Looking at the sender's address, I guess the one recently described is not. > Some time ago I wrote a simple desk calculator for myself using Yacc and > Lex, as suggested by the example in the Yacc document. My excuse was that > I wanted a simple floating point capability, with trig and fractional > powers, which dc and bc don't provide. I also provided for arbitrary length > variable names; a huge improvement over bc in my opinion. My calc has all of these. > Some time later, I enhanced it with a formula definition capability. > I can type a line like: > > #define alpha "(1 - beta^2)^.5)" > #define PI "3.1415926535" > #define theta "t*PI/180" > #define x "((1+A^2-2*A*cos(theta))^.5)" > #define b "((A+x)^2-1)/2/A/x^3" > A=.723 my calc differs by using name=definition format, and it stores the parse tree so it should be more efficiient. More info on calc and UNIX|STAT can be obtained from the address below. Gary Perlman Wang Institute Tyng Road Tyngsboro, MA 01879 USA (617) 649-9731