All mathematical functions accept number arguments and return number.
Function
Description
Abs(x)
Absolute value
Acos(x)
Arc cosine (radians)
Asin(x)
Arc sine (radians)
Atan(x)
Arc tangent (radians)
Ceiling(x)
Round up to nearest integer
Cos(x)
Cosine (radians)
Exp(x)
e to the power of x
Floor(x)
Round down to nearest integer
IEEERemainder(x, y)
IEEE 754 remainder: x - y * Round(x/y)
Ln(x)
Natural logarithm
Log(x)
Natural logarithm (1 arg) or log_y(x) (2 args)
Log10(x)
Base-10 logarithm
Max(x, y)
Larger of two numbers
Min(x, y)
Smaller of two numbers
Pow(x, y)
x to the power of y
Round(x)
Round to nearest integer
Round(x, digits)
Round to digits decimal places
Sign(x)
-1, 0, or 1
Sin(x)
Sine (radians)
Sqrt(x)
Square root
Tan(x)
Tangent (radians)
Truncate(x)
Remove fractional part (towards zero)
Conditional functions
Function
Description
if(condition, trueValue, falseValue)
Returns trueValue when condition is true, otherwise falseValue. Arguments are lazily evaluated.
ifs(cond1, val1, cond2, val2, ..., default)
Evaluates condition/value pairs in order. Returns the value of the first truthy condition, or default if none match. Must have an odd number of arguments.
NCalc compatibility matrix
Feature
Status
Notes
Arithmetic operators
✅ Supported
Comparison operators
✅ Supported
Logical operators (&&||!)
✅ Supported
Short-circuit evaluation
Bitwise operators
✅ Supported
Ternary operator
✅ Supported
in / not in
✅ Supported
String literals
✅ Supported
Number literals (int, float, scientific)
✅ Supported
Boolean literals
✅ Supported
Date literals #YYYY-MM-DD#
✅ Supported
Parameter references [name]{name}
✅ Supported
List values (a, b, c)
✅ Supported
For use with in
Built-in math functions
✅ Supported
See table above
if / ifs conditional functions
✅ Supported
Custom functions
✅ Supported
Via functions option
Lazy parameters
✅ Supported
Via lazyParams option
Result caching
❌ Won't implement
Cache at the call site in a way that suits your application