/* ** ** Eval.c A floating point expression evaluator. ** Main source module. ** ** v1.18 7-11-05 ** Fixed bug where the constant list wasn't quite in alphabetic ** order and this caused the value of _qe to be incorrectly ** reported as unassigned. ** ** v1.17 4-27-05 ** Modified so that unary operators do not take precedence over ** the power operator (^), so that -2^2 = -4 rather than 4. ** This makes Eval more consistent with C and FORTRAN precedence ** rules. ** ** v1.16 9-7-04 *Added colon as command separator and check ** *EVAL_STARTUP environment variable. ** *Updated constants with 2002 CODATA ** (http://physics.nist.gov/constants/) ** Known bug: The colon separator doesn't work immediately ** after "Press for more..." ** ** v1.15 11-7-03 Added an icon to the Win32 version. ** ** v1.14 3-5-99 ** *Fixed bug where bessi(0,0) returned 0 instead of 1. ** *Fixed source so that it compiles without warnings under ** gcc -O2 -Wall ** *Cleaned up the files from when I used to distribute Eval on Simtel ** and Garbo. Deleted redundant files from the distribution. ** *Updated address information. ** ** v1.13 4-13-93 ** *I changed the command line argument interpretation so that eval ** could evaluate a single expression and quit. ** ** v1.12 4-9-93 ** *I added a default write directory and read path for scripts, ** and I added the ability to specify a certain page of help. ** ** v1.11 approx 2/93 ** *A version I never released. I added better script support. ** ** v1.10 approx 1/93 ** *A friend of mine asked me to put Eval in the public domain, ** so I figured I'd better dress it up a little. I added more ** flexible output (user specified precision), automatic pausing ** every 22 lines, and the ability to specify input and output ** in any number base. ** ** v1.00 9/88 ** *Eval was originally written to be a flexible PC calculator. ** Since I work in a lab where bessel functions are frequently used, ** I placed emphasis on putting bessel functions in the code. I ** also wanted something more powerful than a simple mock-up of an ** actual calculator. And since I own an Amiga but work with ** IBM PC clones, I used ANSI C for portability. This version ** stayed fairly constant over four years, and I ran it on unix, ** VMS, and PC (Amiga, IBM, Mac) platforms. ** ** Eval is a floating point expression evaluator. ** Copyright (C) 1993-2006 http://willus.com ** ** This program is free software; you can redistribute it and/or modify it ** under the terms of the GNU General Public License as published by the ** Free Software Foundation; either version 2 of the License, or any ** later version. ** ** This program is distributed in the hope that it will be useful, but ** WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ** General Public License for more details. ** ** You should have received a copy of the GNU General Public License along ** with this program; if not, write to the Free Software Foundation, Inc., ** 675 Mass Ave, Cambridge, MA 02139, USA. ** ** Originally written 5/89 in ANSI C ** */