This calculator has a very simple window, but can do a lot of math. The expression must be typed in, the advantage with this is that they can be modified or corrected easily and the expression is saved on a list and can be reused.
EE: Use exponent notation (1E5) when number is a bit large or small.
4 & 9: Use up to this amount of digits after the decimal point, will use exponent notation for large numbers, but not for small numbers (They are shown as 0).
Int: Do not show decimals.
Str: Use the default format for the value, the other formats will fall back to this format for values they cannot handle.
HEX: Show number in hexadecimal, it will also show strings as a list of hex values.
BIN: Show number in binary.
Formats will fall back to Str format for values they cannot handle (Like text).
All expressions is written on the input line and calculated when "ENTER" is pressed. If the field gets red there is something wrong with the expression.
All successful expressions are saved and can be found by clicking the black triangle.
The numeric input in the calculator is very flexible in handling different formats:
123: A plain number, this is an integer.
123.456: A plain number, this is a floating point number.
34.56e12: Using exponent notation for large or small numbers.
34n: It is also possible to use SI notation for large and small numbers.
17ki: Use binary SI notation when calculating on memory or disk space for computers.
4i or 4j: Complex numbers, can be combined with exponent or SI notation (Binary SI notation take precedence)
0xaa or aah: Hex notation
0b1101 or 1101b: Binary notation
There are two caveats in the input format:
Binary SI & complex with i: The binary SI prefix take precedence for kMGTPEZY SI prefix.
E: it can be either exponent notation (i.e. 1E4) or SI prefix. It will be exponent notation if there is a number or +/- next to it, in all other cases it will be SI prefix (i.e. a space after the E secures it is a SI prefix), using a lower case e will always be exponent notation.
As can be seen above both i & j can be used for complex notation. The last letter used is remembered and used when showing complex numbers.
Using "text" will create a text string. String supports a couple of escape codes: \" \\ \r \n \t \b \xXX \uXXXX
The X must be replace with hex digits.
A text string containing a number will automatic be converted to a number if needed. This means "123"+1 is legal and will return 124
The conversion of text strings to numbers is simpler than above and do not support any SI prefixes
It is possible to create variables and use them in expressions.
Code:
VAR name
GLOBALVAR name
VAR name = value
GLOBALVAR name = value
The GLOBAL version will make the variable available anywhere in TestController where an expression can be used, the plain VAR version is only accessible in the calculator.
One way to use VAR is when the same value is used multiple times:
var f=10k;cpxToCLRs(f,par(cpxC(f,3u),cpxL(f,50u),cpxR(100)))
In the above expression I can easily change the f value and redo the calculation.
Any scripting line starting with a equal sign = is passed to a instance of the calculator engine. This means GLOBALVAR is shared between them, but not VAR. Anything within parentheses on a scripting line is also handled by an instance of the calculator.