Multi-function, multi-memory, programmable scientific calculator.
SYNTAX:
For text mode operation: mcalc [math expression] | [-i <input
filename>][-o <output filename>]
For GUI mode operation: qmcalc
- [math expression] is any valid mathematical expression containing numeric
values, arithmetic operators, brackets, function calls, commands, program
execution calls, variable names, constant names or string literals.
brackets: {, }, [, ], (, )
function calls: Sin, Tan, Cos, Arcsin, Arctan, Arccos, Sinh, Cosh, Tanh, Sqr,
Sqrt, Cube, Cubert, Exp, Log, Log10, Ceil, Floor, Abs, FracPart, IntPart, Rnd,
Comb, Perm, CombRep, PermRep, ItemPerm, ItemComb, ItemPermRep, ItemCombRep,
Min, Max, Deriv, Deriv2, Integ, Rand, Inv, Solve, Intersect, Fmin, Fmax, MatSolve,
Round, Frac, ToHex, ToOct, ToBin, ToCmp2Bin, FromHex, FromOct, FromBin, FromCmp2Bin,
PolToRecX, PolToRecY, RecToPolR, RecToPolA, Sum, Prod, AvgMean, AvgMed,
AvgMode, StdDev, Set, SetUni, SetInt, SetDif, SetXDif
arithmetic operators: =, +=, -=, *=, /=, @=, Not, And, Or, Xor,
<, >, <=, >=, ==, !=, +, -, *, /, @, ^, %, Fact, E
commands: Show, ShowSet, Eval, Precision, GetPrecision, Mode, DumpVars, GraphAllPts, SetRecur, GraphPrec,
Help, Version, History
program execution calls: exec <program name>
variable names: $A ... $Z, ANS, ANSSTR, FRACANS
constant names: PI, E
string literals: "hello", "world"
numeric values: 10, -3, 450.231, 4.52e3, 4527.5e-3 (e for scientific notation)
Variables from $A through $Z can also be used to store results from math
operations. The information stored in these variables can be later used in
place of numeric values in a math expression, in which case the value currently
stored in the variable location will be substituted into the math expression
before the evaluation of the expression takes place. In addition to numeric
values these variables can also store string values such as "hello
world" or "$B^2". Concatenation of strings can be performed
using the append operator +=, so if $A currently contains "x^2 +
2*x", $A += " + 4" would set $A to contain "x^2 + 2*x +
4". String comparisons between different string variables can be performed
using the comparison operators ==, !=, <=, >=, <, >. Literal
strings like "hello" must first be put into string variables before
the string comparison operators can be used. The contents stored within string
variables can be evaluated as a mathematical expression by using the EVAL
command. For example: the variable $A can contain the string "$B^2"
and the command EVAL($A) would give the result of the contents currently stored
in the variable $B squared.
Also, variable assignments can accept pasted text from the desktop environment
clipboard. The evaluated results will be stored in the variable or the
pasted expression can be stored in the variable in the form of a string
(enclosed in " ") that can be evaluated later using the EVAL
command.
Note: to avoid infinite recursion which will stall the program, evaluation of
variables names within string variables will by default be evaluated up to 26
levels deep. This means that you can nest variable names such as $B within
another variable like $A and continue on with another variable name nested
within $B and so on, up to 26 levels deep of nesting. The program will simply
refuse to process expressions that nest variables more than the set recursion
limit and display an error message. To increase or decrease the recursion
limit, use the command "Set Recur=" with the desired limit placed
after the equal sign.
Note: hexadecimal and octal based arithmetic can also be performed. All
hexadecimal and octal input values must be integers only. Note when entering
hexadecimal values a "0x" prefix must be entered before the actual
hex digits. When entering octal values a "0" prefix must be entered
before the actual octal digits. To avoid confusion and unnecessary complexity
when processing math expressions, hexadecimal and octal values are only valid
for the following functions, variables, constants and operators:
Note: With the graphical calculator you can enter directly into the text editor
window by clicking on it and entering your information from the keyboard. This is
useful for when you want to type in characters not found on the calculator keypad.
-
NOT
-
AND
-
OR
-
XOR
-
<
-
>
-
<=
-
>=
-
==
-
!=
-
+
-
-
-
*
-
/
-
@
-
FROMHEX
-
TOHEX
-
FROMOCT
-
TOOCT
-
FROMBIN
-
TOBIN
-
FROMCMP2BIN
-
TOCMP2BIN
-
MIN
-
MAX
-
SET
-
SETUNI
-
SETINT
-
SETDIF
-
SETXDIF
-
ITEMPERM
-
ITEMCOMB
-
ITEMCOMBREP
-
ITEMPERMREP
-
=
-
|=
-
&=
-
+=
-
-=
-
*=
-
/=
-
@=
-
^
-
%
-
FACT
-
(
-
)
-
[
-
]
-
{
-
}
-
$A...$Z
-
ANS
-
ANSSTR
The purpose of each operator or function are as follows:
- =
-
assignment into any one of 26 variables: $A to $Z.
- +=
-
add results of math operation to specified variable and store results into
variable, or in the case of string variables append another string to what is
currently stored.
- -=
-
subtract results of math operation from specified variable and store results
into variable.
- *=
-
multiply results of math operation to specified variable and store results into
variable.
- /=
-
divide results of math operation from specified variable and store results into
variable.
- @=
-
modulus results of math operation from specified variable and store results
into variable.
- &=
-
"AND" results of math operation from specified variable and store
results into variable. Does bitwise "AND" of octal and hexadecimal
values.
- |=
-
"OR" results of math operation from specified variable and store
results into variable. Does bitwise "OR" of octal and hexadecimal
values.
- %
-
percent of number or divide number by 100.
- ToHex
-
Conversion from decimal (base 10) to hexadecimal (base 16) form.
-
ToOct
-
Conversion from decimal (base 10) to octal (base 8) form.
- ToBin
-
Conversion from decimal (base 10) to binary (base 2) form.
-
ToCmp2Bin
-
Conversion from decimal (base 10) to two's complement binary (base 2) form.
-
FromHex
-
Conversion from hexadecimal (base 16) to decimal (base 10) form.
-
FromOct
-
Conversion from octal (base 8) to decimal (base 10) form.
- FromBin
-
Conversion from binary (base 2) to decimal (base 10) form.
-
FromCmp2Bin
-
Conversion from two's complement binary (base 2) to decimal (base 10) form.
- +
-
Add
- -
-
Subtract
- *
-
Multiply
- /
-
Divide
- @
-
Modulus
- ^
-
To the power of
- <
-
Less than (in either numeric or alphabetical order).
- >
-
Greater than (in either numeric or alphabetical order).
- <=
-
Less than or equal (in either numeric or alphabetical order).
- >=
-
Greater than or equal (in either numeric or alphabetical order).
- ==
-
Equal (in either numeric or alphabetical order).
- !=
-
Not equal (in either numeric or alphabetical order).
- Not
-
Logical not (bitwise not for octal and hexadecimal values).
- And
-
Logical and (bitwise and for octal and hexadecimal values).
- Or
-
Logical or (bitwise or for octal and hexadecimal values).
- Xor
-
Logical exclusive or (bitwise exclusive or for octal and hexadecimal values).
- Sin
-
Sine
- Tan
-
Tangent
- Cos
-
Cosine
- ArcSin
-
ArcSine or Reverse Sine
- ArcTan
-
ArcTangent or Reverse Tangent
- ArcCos
-
ArcCosine or Reverse Cosine
- Sinh
-
Hyperbolic Sine
- Cosh
-
Hyperbolic Cosine
- Tanh
-
Hyperbolic Tangent
- RecToPolr
-
Rectangular to Polar Return Radius
- RecToPola
-
Rectangular to Polar Return Angle
- PolToRecx
-
Polar to Rectangular Return X
- PolToRecy
-
Polar To Rectangular Return Y
- E
-
Scientific notation
- Min
-
Minimum of two numbers or a range of numbers
- Max
-
Maximum of two numbers or a range of numbers
- Deriv
-
Derivative
- Deriv2
-
Second Derivative
- Integ
-
Integral
- Solve
-
Root Solving
- Intersect
-
Find points of intersection
- Fmin
-
Function Minimum
- Fmax
-
Function Maximum
- MatSolve
-
Solve system of linear equations put in matrix-vector form
- Sqr
-
Square
- Sqrt
-
Square root
- Cube
-
Cube
- Cubert
-
Cube root
- Exp
-
Exponent of E
- Log
-
Natural logarithm
- Log10
-
Logarithm of 10
- Ceil
-
Ceiling
- Floor
-
Floor
- Rand
-
Random Number
- Inv
-
Multiplicative Inverse
- Frac
-
Fraction arithmetic
- Sum
-
Cumulative sum of a series of numbers, file name input accepted
-
Prod
-
Cumulative product of a series of numbers, file name input accepted
-
AvgMean
-
Mean average of a series of numbers, file name input accepted
-
AvgMed
-
Median average of a series of numbers
- AvgMode
-
Mode average of a series of numbers
- StdDev
-
Standard deviation of a series of numbers, file name input accepted
-
Graph
-
Plot graph of expression (not available in text mode)
- Graph
fmin(...)
-
Plot graph of minimum of an expression (not available in text mode)
-
Graph fmax(...)
-
Plot graph of maximum of an expression (not available in text mode)
-
Graph deriv(...)
-
Plot graph of derivative of an expression (not available in text mode)
-
Graph derive2(...)
-
Plot graph of 2nd derivative of an expression (not available in text mode)
-
Graph integ(...)
-
Plot graph of integral of an expression (not available in text mode)
-
Graph solve(...)
-
Plot graph of a root of an expression (not available in text mode)
-
Graph intersect(...)
-
Plot graph of points of intersection of expression(s) (not available in text mode)
-
Trace (click on trace button)
-
Function tracing feature which allows for graphically tracing each plotted data point for each function
plotted on the graph. The function tracing command include the following features:
- additional clicks on the trace button will put trace point at the beginning of each graph
- clicking the clear button will exit trace mode
- blue will be used for color of function trace point.
- coordinates will appear and change on function plotter window corresponding to the
coordinate currently at the trace point.
- use arrow keys to move the trace point on the function graph while in trace mode
- PageUp/PageDown keys for moving whole number distances at a time while in trace mode
- the enter button will toggle between end points of function graph while in trace mode
-
Round
-
Round to the specified exponent
- Rnd
-
Round to nearest integer
- Abs
-
Absolute value
- FracPart
-
Fractional part of number
- IntPart
-
Integer part of number
- Fact
-
Factorial
- Comb
-
Combination
- Perm
-
Permutation
- CombRep
-
Combination with repetition
- PermRep
-
Permutation with repetition
- Set
-
Create A Positive Integer Set
- SetUni
-
Set Union
- SetInt
-
Set Intersection
- SetDif
-
Set Difference
- SetXDif
-
Symmetric Set Difference
- ItemComb
-
List combinations of items
- ItemPerm
-
List permutations of items
- ItemCombRep
-
List combinations with repetition of items
- ItemPermRep
-
List permutations with repetition of items
- Eval
-
Evaluation of the contents of string variables
- Show
-
Show the contents of string variables including the contents of any variables
nested within them
- ShowSet
-
Show the contents of string variables containing a positive integer set in set notation.
If the string variable given does not contain a set recognized in set notation then a
*** Not A Set *** message will be displayed
- Mode=
-
Set the angle unit to either radians or degrees
- Precision=
-
Set the unit precision to float, double, long double or longnum
-
GetPrecision
-
Show the unit precision details
-
DumpVars
-
Display the contents of all variables: $A-$Z, ans, ansstr, fracans
-
GraphAllPts
-
Sets calculator to graph all points even for those points approaching -inf and +inf
in plot mode when this is set to true. If set to false the calculator will show small
red points as -inf or +inf for points approaching infinity.
- SetRecur=
- Set the variable nesting limit when using the Eval or Show commands
- GraphPrec=
- Set the default graphing interval precision for graphing
functions which defaults to .0001 if not explicitly set.
- Help
- Show this help screen
- Exec
- Execution of pre-written calculator program files, click for more information
on writing and running calculator programs
- Version
- Shows the current software version number.
- History
- Shows command history list (1 to 50 stored commands).
The following constants and answer variables are also available:
- PI
-
Pi constant set to the precision of the current precision unit
-
E
-
E natural exponent set to the precision of the current precision unit
-
ANS
-
Decimal answer to the evaluated expression
- ANSSTR
-
Literal, octal or hexadecimal answer to the evaluated expression
-
FRACANS
- Fraction answer to the evaluated
expression
Entering "quit" from the interactive prompt will stop the programn
This help message will be displayed by entering "help" on the
program's interactive prompt or by specifying --help as an argument on the
shell command line.
Function specific help will be displayed by entering "help" <name
of function> on the shell command line. For example: "help deriv"
will display a help screen specific to the derivative command. Functions that
do not have specific help screens are simple and self explanatory from the
general help screen. Help documentation can be accessed in graphics mode by
clicking on the help button on the calculator interface. Function specific help
can be accessed in graphics mode by clicking on the link for each calculator
command.
different angle units can be specified by entering: mode=radian or mode=degree
different precision units can be specified by entering: precision=float,
precision=double, precision=longdouble or precision=longnum
with each unit having a digit precision of:
-
Float (7-digit precision)
-
Double (15-digit precision)
-
Long Double (19-digit precision)
-
Long Number (arbitrary precision)
Each precision unit: float, double, long double, long number is actually an
individual calculator and each calculator has its own set of 26 letter
variables for DECIMAL value storage, excluding string variables which are
shared globally. By default all variables of a calculator are transferred over
to the new calculator after a precision unit change.
Alternatively you can choose not to do this and have each calculator preserve
its own set of decimal variables by specifying ",keepvars" after the
precision unit name in the precision command. example:
precision=longnum,keepvars which will skip tranferring variables from the
previous calculator to the long number calculator.
Warning: when you use base conversion commands: ToHex, ToOct, ToBin,
ToCmp2Bin, FromHex, FromOct, FromBin, FromCmp2Bin
any assignment to variables: $A...$Z will assign to the long number calculator
variables as well as the variables in the currently used calculator
-
Note:
because the Long Number unit is custom designed and developed and not an
inherent part of the programming language used to developed this application,
calculations involving Long Number units depending on the complexity of the
operations or functions may take a significantly longer time to complete than
those involving Floats, Doubles, or Long Doubles.
-
Note:
because of performance and speed issues Long Number operations and functions
involving matrices, statistics, trigonometry, roots, natural logarithms and
exponents will be using long double precision (19-digit precision) instead of
arbitrary precision.
The full unit name and precision information as shown in the format above can
be retrieved by entering the "get precision" command at the command
line On the program's interactive prompt the current settings for angle units
and the unit's digit precision are displayed as
MCALC:<prec>:<angle>
where <prec> can be any one of:
-
"flt": specifying float,
-
"dbl": specifying double,
-
"ldbl": specifying long double,
-
"lnum": specifying long number
where <angle> can be any one of:
-
"rad": specifying radian
-
"deg": specifying degree
The arguments to the program can be entered directly from the command line or
from an input file. Alternatively mcalc can be run interactively by typing
mcalc on the command line without any arguments. While in interactive mode
command line continuation for long commands which spans more than one line can
be accomplished by entering the back slash character "\\" at the end
of a line. The continuation character is not required in graphics mode and
commands may span multiple lines with the "Enter" key pressed to
indicate the end of a command. Pre-written calculator program files can also be
loaded and executed either interactively or from an input file enter "help
exec" for more information on writing and running calculator programs.
When entering from an input file enter the name of the input file after the
program name and "-i". Each line of the input file should contain the
same arguments that you would normally type from the command line to perform
the calculation.
-
NOTE:
all expressions within input files must indicate termination by entering a
semi-colon ";". Comments in input files can be specified by starting
a line with a hash mark "#". Comment lines or blocks of comment lines
must also indicate termination with a semi-colon.
-
Optionally, a short one line description of the input file can be written at
the beginning of the input file to provide a short description in the table of
available calculator programs shown in the GUI version of the calculator.
The description line must start with "# description=" before the actual
description phrase in order for the program to recognize it as a description
line.
-
Qmcalc will reserve the following characters to use in calculator script files
for special purposes: : ; # = &
So in comment lines that are indicated with the "#" character at the start
of the line, some specific characters must be replaced with their associated
escape sequences for qmcalc to recognize and process them correctly:
To display these characters while reading from a calculator script file ".prg"
or input data file ".in", the following escape sequences must be used instead:
- & or & for the ampersand character: &
- ≻ or ; for the semicolon character: ;
- &hash; or # for the number sign or hash character: #
- &col; or : for the colon character: :
- &eq; or = for the equal character: =
Metric to English unit conversions
Metric to/from English unit conversions can be accomplished by executing the
following programs using the EXEC command:
|
Length unit conversions
|
lencon.prg
|
|
Area unit conversions
|
areacon.prg
|
|
Volume unit conversions
|
volcon.prg
|
|
Weight unit conversions
|
wgtcon.prg
|
|
Power unit conversions
|
powcon.prg
|
|
Energy unit conversions
|
energycon.prg
|
|
Angle unit conversions
|
anglecon.prg
|
|
Temperature unit conversions
|
tempcon.prg
|
Area and volume of common shapes
Two programs are provided to determine the area and volume of common shapes
|
To determine the area of common plane figures execute
|
area.prg
|
|
To determine the surface area and volume of common shapes execute
|
volume.prg
|
Calculator test programs and input files
The following program and data input files are provided for testing the
calculator:
|
sample.prg
|
program for testing general calculator operations.
|
|
sample2.prg
|
test program file called from within sample.prg.
|
|
dice.prg
|
program for playing a simple game of dice.
|
|
pyth.prg
|
program to determine the length of the hypotenuse of a right angle triangle
using the Pythagorean theorem.
|
|
loan.prg
|
sample loan calculation program with function graph output. graphics output can
only be shown on GUI mode calculator.
|
|
calcinteg.prg
|
program to calculate an approximation of an integral by using Taylor
polynomials.
|
|
errcond.in
|
test deliberate input errors for detection of error conditions.
|
|
graphtest.in
|
test program for calculator graph plotting operations.
|
|
matsolve.in
|
matrix solving test file.
|
|
quicktest.in
|
Short quick test file for qmcalc excluding lengthy calculations and program calls.
|
|
testcalc.in
|
Calculator test data input file for testing all operations of the calculator.
|
|
testexec.in
|
calculator script programs execution tests.
|
|
testset.in
|
test program for calculator set operatons.
|
Program Options
-i <filename> : specify an input file
-o <filename> : specify an output file (Default: standard display output)
-consoleio : specify console mode input/output instead of standard I/O
mcalc with no arguments to run interactively in text mode.
qmcalc with no arguments to run in GUI mode
Option to run input data files in GUI mode:
starting with version 2.7 the option to run input test files from the GUI version of the
calculator is available. Clicking on the "EXEC" button on the calculator form
will bring up a table listing all available programs for the calculator to run.
Optionally, a short one line description of the input file can be written at
the beginning of the input file to provide a short description in the table of
available calculator programs shown in the GUI version of the calculator.
The description line must start with "# description=" before the actual
description phrase in order for the program to recognize it as the description.