EuroCalc is a calculator from the collection EuroTool
which computes input expression consisting of numbers, operators, functions, and priority parentheses.
It calculates mathematical expressions from the command line or interactively in a window.
EuroCalc treats all numbers internally as floating point numbers and it works with 96-bit mantissa and 32-bit exponent.
The input expression can be entered at the command line, for instance
eurocalc 12.345 * (-6.78) + 0x9ABC, optionally followed by equal sign =.
EuroCalc will convert all numbers to decimal, remove unnecessary spaces, repeat the corrected assignment
and print the calculated result on a new line:
When EuroCalc is run without arguments, it displays a (pseudo)graphic window and it can be used interactively.
Numbers can be entered in decimal, hexadecimal, octal, or binary form and their notation may be mixed in one expression. Accepted notations:
12_34512_345k0n12_3451234_5678_9ABCh0x1234_5678_9ABC123_456q0o123_4560101_0101b0y0101_0101123.45123.45E5 or 123E-3.Parsing algorithmus can distinguish between 123E4h (hexadecimal number 0x123E4) and
123E4 (decimal number 123*104=1230000).
The number format of EuroCalc is compatible with EuroAssembler but it is not limited to 63 bits.
| Operation | Operator | Arity | Priority | Example |
|---|---|---|---|---|
| FnEul | EUL | Function Euler's number with 0 operand | 15 | eul = 2.718_281_828_459_045_235_360_288 |
| FnPi | PI | Function Ludolf's number with 0 operand | 15 | pi = 3.141_592_653_589_793_238_462_644 |
| FnPlus | + | Unary operation | 12 | +2 = 2 |
| FnMinus | - | Unary operation | 12 | -2 = -2 |
| FnFactorial | ! | Reversed operation | 14 | 3 ! = 6 |
| FnAdd | + | Binary operation | 2 | 2 + 3 = 5 |
| FnSubtract | - | Binary operation | 2 | 2 - 3 = -1 |
| FnMultiply | * | Binary operation | 4 | 2 * 3 = 6 |
| FnDivide | / | Binary operation | 4 | 3 / 2 = 1.5 |
| FnPower | ^ | Binary operation | 6 | 2 ^ 3 = 8 |
| FnSin | SIN | Function sine with 1 operand | 10 | sin (pi / 6) = 0.5 |
| FnCos | COS | Function cosine with 1 operand | 10 | cos (pi / 6) = 0.5 |
| FnTan | TAN | Function tangent weurocalcith 1 operand | 10 | tan (pi / 4) = 1 |
| FnCot | COT | Function cotangent with 1 operand | 10 | cot (pi / 4) = 1 |
| FnSec | SEC | Function secant with 1 operand | 10 | sec pi = -1 |
| FnCsc | CSC | Function cosecant with 1 operand | 10 | csc (pi/2) = 1 |
| FnExp | EXP | Function exponent with 1 operand | 10 | exp 1 = 2.718_281_828_459_045_235_360_288 |
| FnLn | LN | Function natural logarithm with 1 operand | 10 | ln eul = 1 |
| FnLg | LG | Function decimal logarithm with 1 operand | 10 | lg 100 = 2 |
Operation with higher priority are performed first, but the priority may be altered with parenthesis.
All operators and number modifiers are case insensitive. All elements (numbers, operators, parenthesis)
may be separated with spaces. The number notation can be enhanced with underscores
_ for better readability.
Arguments of trigonometric functions are entered in radians.
Example of using EuroCalc to calculate a SINE function table for angles 0°, 10°, 20°,...90° in Windows:
Both programs in this source file have the name eurocalc
. The linked executable file for Linux has the name
eurocalc.x
and the version for Windows has the name eurocalc.exe
.
euroasm eurocalc.htm.
EUROASM CPU=X64, Unicode=No, NoWarn=0563
INCLUDE "argument.htm" ; Assemble the module argument.htm.
INCLUDE "calcmain.htm" ; Assemble the module calcmain.htm (common for both OS).
Linux GUI version works with ANSI terminal in character pseudo graphic mode.
INCLUDE "calclinc.htm" ; Assemble the module calclinc.htm (Linux console subsystem).
INCLUDE "calcling.htm" ; Assemble the module calcling.htm (Linux pseudographic subsystem).
eurocalc PROGRAM Format=ELFX, Width=64, Entry=MainCon ; Executable Linux file eurocalc.x
.
LINK calclinc.obj, calcling.obj, calcmain.obj, argument.obj ; Program EuroCalc for Linux has four modules.
ENDPROGRAM eurocalc
INCLUDE "calcwinc.htm" ; Assemble the module calcwinc.htm (Windows console subsystem).
INCLUDE "calcwing.htm" ; Assemble the module calcwing.htm (Windows graphic subsystem).
eurocalc PROGRAM Format=PE, Width=64, Entry=MainCon, IconFile=eurocalc.ico ; Executable Windows file eurocalc.exe
.
LINK argument.obj, calcmain.obj, calcwinc.obj, calcwing.obj ; Program EuroCalc for Windows has four modules.
ENDPROGRAM eurocalc