The calculator
On the calculator we use NCalc, which is a mathematical expressions evaluator in .NET.
NCalc can parse any expression and evaluate the result, including static or dynamic parameters and custom functions.
To see more details on Ncalc, click here.
To see more details on Ncalc, click here.
For documentation, here is the table of content:
- description: overall concepts, usage and extensibility points
- operators: available standard operators and structures
- values: authorized values like types, functions, …
- functions: list of already implemented functions
- parameters : on how to use parameters expressions
You can use also the constants:
Pi = 3.14159265
E = 2.71828183
Circular function need the arguments in radians.
Radians function can be used to convert degrees to radians. See example.
Some formula examples:
= Sqrt([a])
= Pi*Pow([r],2)
Sin(α) = sin(radians([α])) (α in degrees)
Format of numbers that can be used:
- 2.45
- 1e3
Formulas are case sensitive
Most used functions:
Name | Description | Usage | Result |
---|---|---|---|
Abs | Returns the absolute value of a specified number. | Abs(-1) | 1M |
Acos | Returns the angle whose cosine is the specified number. | Acos(1) | 0d |
Asin | Returns the angle whose sine is the specified number. | Asin(0) | 0d |
Atan | Returns the angle whose tangent is the specified number. | Atan(0) | 0d |
Ceiling | Returns the smallest integer greater than or equal to the specified number. | Ceiling(1.5) | 2d |
Cos | Returns the cosine of the specified angle. | Cos(0) | 1d |
Exp | Returns e raised to the specified power. | Exp(0) | 1d |
Floor | Returns the largest integer less than or equal to the specified number. | Floor(1.5) | 1d |
IEEERemainder | Returns the remainder resulting from the division of a specified number by another specified number. | IEEERemainder(3, 2) | -1d |
Log | Returns the logarithm of a specified number. | Log(1, 10) | 0d |
Log10 | Returns the base 10 logarithm of a specified number. | Log10(1) | 0d |
Max | Returns the larger of two specified numbers. | Max(1, 2) | 2 |
Min | Returns the smaller of two numbers. | Min(1, 2) | 1 |
Pow | Returns a specified number raised to the specified power. | Pow(3, 2) | 9d |
Round | Rounds a value to the nearest integer or specified number of decimal places. The mid number behaviour can be changed by using EvaluateOption.RoundAwayFromZero during construction of the Expression object. | Round(3.222, 2) | 3.22d |
Sign | Returns a value indicating the sign of a number. | Sign(-10) | -1 |
Sin | Returns the sine of the specified angle. | Sin(0) | 0d |
Sqrt | Returns the square root of a specified number. | Sqrt(4) | 2d |
Tan | Returns the tangent of the specified angle. | Tan(0) | 0d |
Truncate | Calculates the integral part of a number. | Truncate(1.7) | 1 |
Radians | Convert degrees to radians. | Radians(30) | 0.5236 |
Degrees | Convert radians to degrees. | Degrees(0.5236) | 30 |