MathCmd allows you to enter mathematical expressions and see the results like a calculator, only easier. You can enter mathematical expression, define and use variables, and define custom functions. It is a command line tool that runs in a MS Windows command prompt window.
MathCmd is free to use. See license.txt for more information.
You need Microsoft .Net Framework version 2.0 or later to run MathCmd.
To start simply double-click the MathCmd.exe file or start a command prompt in the directory where you placed MathCmd.exe and type "MathCmd". When a session ends, the state of MathCmd is saved so that the next time you start all of your variables and functions will be available. To end a session type "quit" or "exit". Do not just close the command window or the state will not be saved!
If you have any questions, comments, or find bugs please report them to WorldTreeSoftware.com. If you find a bug please send a copy of the expressions in the command prompt window that led up to the problem by clicking the icon in the top right corner, choosing Edit->Select All, then choosing Edit->Copy.
Mathematical expressions are entered using basic calculator or computer style syntax. Use parenthesis to group expressions.
pi / 2 + sin(x)
pi / (2 + sin(x))
See the index for a list of operators. Relational operators used to compare values require some further explanation. Less than (<), greater than (>), not equal(<>), less than or equal (<=), greater than or equal (>=), and the equality operator (==). Relational operators return either 1 if the relation is true, or 0 if it is false.
(a * b) <> 0
The following examples define some boolean functions. Note that any value that is not zero is defined to be true, and zero is false.
and(a, b) = (a * b <> 0)
or(a, b) = (a + b > 0)
not(a) = (a == 0)
There are a number of commands available in addition to mathematical expressions.
There is one built in variable called "result". It always contains the result of the last calculation.
To define a variable specify a name followed by the assignment (=) operator, followed by an expression. A variable name must start with a letter and can contain letters or numbers after that. For example:
x = 3
piOver2 = pi/2
There are a number of built in mathematical function. Note that "pi" was not defined as a variable above in the Variables section. That is because it is a contant, not a variable. Constants should be defined as a function with no parameters. When a function has no parameters the parenthesis are optional. So for example, you could use either "pi()" or "pi". Either is valid. A complete list of mathematical functions can be found in the index.
You can also define your own functions. To define a function specify a name followed by parenthesis containing a list of parameters separated by commas, followed by the assignment (=) operator, followed by an expression. A function name must start with a letter and can contain letters or numbers after that. For example:
piOver2() = pi/2
add(a, b) = a + b
To delete a user defined functions use the delete command. Note that parenthesis are required after the name of the function.
delete add()
These conversion functions allow you to enter numbers in other formats.
© 2007 WorldTree Software, All Rights Reserved