Content-type: text/html
ralcalc is also installed as the = command to make using it even quicker.
ralcalc supports SI prefix characters for both input and output:
= 2u/35 2u/35 = 57.1429n
Numbers of the form 1e-3 are also supported, where the "e" indicates a power of ten. Don't mix and match SI prefixes and "e" in the same number (although 1e-3n is valid, 1ne-3 is not - avoid both for less confusion).
The SI prefixes supported are: Y, Z, E, P, T, G, M, k, m, u, n, p, f, a, z, y.
= 1+2x3 1+2x3 = 7 = 1/2^0.5 1/2^0.5 = 0.707107
Brackets ( (), [] ) can be used to control the order in which statements are processed:
= [1+2]x3 [1+2]x3 = 9
Both the square and round brackets can be used and are both directly equivalent, so [1+2)x3 is also valid. Round brackets are more commonly used in mathematics, but the square brackets (and the "x" for multiplication) are included to try to prevent problems with the shell expanding those characters.
ralcalc stores the result of the calculation so that it can be used in the next calculation with the "_" character.
= 2^0.5 2^0.5 = 1.41421 = 1/_ 1/_ = 0.707107
= sin2x2 sin2x2 = 1.81859 = sin[2x2] sin[2x2] = -0.756802
2^0.5 1/_ 238/1064x100
File input is also possible using stdin, i.e. reading interactively directly from the terminal with each line being calculated as normal. To quit, type "q" or "quit" on a new line, use Ctrl-D to indicate the end of file, or use Ctrl-C to cause ralcalc to be terminated.
If either of the file input options are given on the command line, then any calculations given on the command line will be calculated first. If both of the file input options are given, then the calculations from the -f will be carried out first, followed by those from stdin.
= ln 1.0001 ln 1.0001 = 99.995u
Exponent number output format:
= -e ln 1.0001 ln 1.0001 = 9.9995e-05
Raw number output format:
= -r ln 1.0001 ln 1.0001 = 0.000100
Number output format with a specified SI prefix:
= -s m ln 1.0001 ln 1.0001 = 0.099995
If an unknown character is included in the equation, an "unknown token" error will be generated. The error marker points to the invalid character.
= 34/3@2 Error: 34/3@2 ^ unknown token
If an invalid number is included, a "bad number" error will be generated. The error marker points to the end of the invalid number.
= 3.14.159x2.8^2 Error: 3.14.159x2.8^2 ^ bad number
If the number of open and close brackets do not match, a "mismatched brackets" error will be generated. The error marker position has no significance.
= 5/[[2+3]*9 Error: 5/[[2+3]*9 ^ mismatched brackets
If an operator appears in an invalid position, an "invalid operator" error will be generated. The error marker indicated the invalid operator.
= 3^^7 Error: 3^^7 ^ invalid operator
If a bracket appears in an invalid position, an "invalid bracket" error will be generated. This type of error often overlaps with other errors, so there will be a number of messages written to the screen. It is best to fix this error first as it will likely be the root cause of the problem. The error marker indicates the invalid bracket.
= [2+]3 Error: [2+]3 ^ invalid bracket Error: [2+]3 ^ invalid operator
If ralcalc is unable to allocate some memory, an "out of memory" error will be generated.
Internal error: If the parser notices two numbers next to each other yet does not generate a "bad number" error, the a "duplicate number" error will be generated. This should never happen.
Internal error: If an unknown error code is passed to the error output function, an "unknown error" will be generated and the invalid error code displayed. This should never happen.
If you find a bug, please submit a report at http://bugs.launchpad.net/ralcalc