By Gamall
Date: 04-16-2008
Version: 0.1
*****************************************************************
** m.E.M.E **
** - **
** Minimalist Evaluator for Mathematical Expressions **
*****************************************************************
#-----------------------------------------------------------#
# TITLE : m.E.M.E #
# Minimalist Evaluator for Mathematical Expressions #
# TYPE : Utility #
# VERSION : 0.1 #
# AUTHOR : Gamall Wednesday Ida #
# WEBSITE : http://gamall-ida.com #
# #
# FILESIZE : ~800 Ko #
# OS : Linux, Mac, Windows #
# RELEASE DATE : March 2008 #
#-----------------------------------------------------------#
+ TABLE OF CONTENTS
+=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-o +
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1. BRIEF DESCRIPTION
2. WHAT IS AN EXPRESSION?
-Literals and simple expressions
-Bound expressions
-Units
-Logic and conditional expressions
3. THE STANDALONE PROGRAM
-The run modes
-Application of 'replace' mode to
Quake configuration files.
4. THE PACKAGE
5. CONTACT
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ BRIEF DESCRIPTION
+=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-o +
m.E.M.E (pronounce m-ee-m-ee) stands for "Minimalist Evaluator
for Mathematical Expressions". And that is exactly what it is.
'Evaluator for Mathematical Expressions' because its purpose is
to compute mathematical expressions. For instance "2+2" yields
4. Less trivially, "let x = pi/2 in 1+ sqrt cos (x/2)" yields
1.84089641525. It is meant to be used as a library for other
programs, but the standalone executable can be used as a
command-line calculator and a preprocessor for configuration
files.
'Minimalist' because there are points which make it simpler and
faster (it is *very* fast) but limit its range:
-> It uses floating-point arithmetic (64bits, as per OCaml
`float' type) instead of exact arithmetic, hence a loss of
precision on some expressions:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
4.63246686343E-08 + 1
+ exp(2+sin(log(cos(
acos(-pi/2+tan(atan(pi))-1)))))
/sqrt(pi*5E15)
> 1.00000009265
exp(2+sin(log(cos(
acos(-pi/2+tan(atan(pi))-1)))))
/sqrt(pi*5E15)
- 4.63246686343E-08 + 1
> 1
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-> It supports variables but not functions. So while you can
write
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
let x = pi/2 in 1+ sqrt cos (x/2)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
... you can't write anything like
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
let f(x) = 1+ sqrt cos (x/2) in f(pi/2)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-> It does not support any kind of loops. So for instance there
is no sum (big Sigma symbol in math) or product (big Pi
symbol), because that kind of functionality couldn't be added
elegantly to the program. This is a consequence of the previous
point.
-> It is not, of course, a system for symbolic computation.
+ THE PACKAGE
+=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-o +
- The Source Code
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~o -
The source code for m.E.M.E is released under the GNU General
Public License.
This program is written in Objective Caml, using ocamllex and
ocamlyacc to build the lexer and the parser.
- The Binaries
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~o -
m.E.M.E is shipped with statically compiled binaries for
GNU/Linux, which may or may not work on your own system. If
they don't you will just have to compile it from source. You
will need an OCaml compiler. In most cases, you will just need
to run the build script in the /src directory.
The Windows binary should work on any Windows system from 95
on.
+ CONTACT
+=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-o +
If you need help, or have suggestions, comments, insults,
praise or in general, anything to say about this program you
expect me to read and answer to, please post on the program's
topic on my website:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
http://gamall-ida.com/f/viewtopic.php?f=3&t=396
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Do NOT, *EVER*, contact me by mail unless I specifically ask
you to do so, or if my forum is unavailable for a long time.
+ END OF FILE
+=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-o +
+-----------------------------+
| File generated with 'GaTeX',|
| an ASCII typesetting system |
| by Gamall Wednesday Ida. |
| http://gamall-ida.com |
+-----------------------------+
Build: Tue Apr 15 15:53:03 2008
File : F:readme-mEME.GaTeX.source