Technical Briefs
ROHAN help Files
calc
calc, a command line calculator, is a program that evaluates mathematical expressions. An expression is any decimal number in integer or real format. It may also be a binary, octal or hexidecimal integer prefixed by, respectively, b, o, or h, or an ASCII character, prefixed by @. An expression is also any expression preceded by one of the following:
sin log - (unary minus)
cos ln + (unary plus)
tan sqrt ~ (one's complement)
atan exp
or any two expressions separated by one of the following operators:
Exponentiation: :
Multiplication: * x X
(none: implied multiplication)
Division: /
Modulo: %
Addition: +
Subtraction: -
Left shift: <
Right shift: >
Bitwise AND: &
Bitwise XOR: ^
BitWise OR: |
An expression is any expression preceded by an opening delimeter:
{ [ (
and followed by a closing delimiter:
} ] )
The special symbols pi and PI are also valid expressions. So is prev which returns the value of the previous equation (multiple-expression mode only).
If the expression is omitted from the command line, then the program will be in multiple-expression mode and repeatedly read expressions from the standard input until it encounters an empty line or an end of file.
|
|