Table of Contents

Class MathHelper

Namespace
NCalc.Helpers
Assembly
NCalc.Core.dll

Utilities for doing mathematical operations between different object types.

public static class MathHelper
Inheritance
MathHelper
Inherited Members

Methods

Abs(object?, MathOptions, CultureInfo)

public static object Abs(object? a, MathOptions options, CultureInfo cultureInfo)

Parameters

a object
options MathOptions
cultureInfo CultureInfo

Returns

object

Acos(object?, CultureInfo)

public static object Acos(object? a, CultureInfo cultureInfo)

Parameters

a object
cultureInfo CultureInfo

Returns

object

Add(object?, object?, MathOptions, CultureInfo)

public static object? Add(object? a, object? b, MathOptions options, CultureInfo cultureInfo)

Parameters

a object
b object
options MathOptions
cultureInfo CultureInfo

Returns

object

Asin(object?, CultureInfo)

public static object Asin(object? a, CultureInfo cultureInfo)

Parameters

a object
cultureInfo CultureInfo

Returns

object

Atan(object?, CultureInfo)

public static object Atan(object? a, CultureInfo cultureInfo)

Parameters

a object
cultureInfo CultureInfo

Returns

object

Atan2(object?, object?, CultureInfo)

public static object Atan2(object? a, object? b, CultureInfo cultureInfo)

Parameters

a object
b object
cultureInfo CultureInfo

Returns

object

Ceiling(object?, MathOptions, CultureInfo)

public static object Ceiling(object? a, MathOptions options, CultureInfo cultureInfo)

Parameters

a object
options MathOptions
cultureInfo CultureInfo

Returns

object

Cos(object?, CultureInfo)

public static object Cos(object? a, CultureInfo cultureInfo)

Parameters

a object
cultureInfo CultureInfo

Returns

object

Divide(object?, object?, MathOptions, CultureInfo)

public static object? Divide(object? a, object? b, MathOptions options, CultureInfo cultureInfo)

Parameters

a object
b object
options MathOptions
cultureInfo CultureInfo

Returns

object

Exp(object?, CultureInfo)

public static object Exp(object? a, CultureInfo cultureInfo)

Parameters

a object
cultureInfo CultureInfo

Returns

object

Factorial(object?)

Computes the factorial of an integral value, keeping the type of the input. The input is limited to 170, the largest factorial a double can hold. An int, long or decimal product that leaves the range of its type throws an OverflowException instead of silently wrapping around.

public static object Factorial(object? result)

Parameters

result object

Returns

object

Floor(object?, MathOptions, CultureInfo)

public static object Floor(object? a, MathOptions options, CultureInfo cultureInfo)

Parameters

a object
options MathOptions
cultureInfo CultureInfo

Returns

object

IEEERemainder(object?, object?, CultureInfo)

public static object IEEERemainder(object? a, object? b, CultureInfo cultureInfo)

Parameters

a object
b object
cultureInfo CultureInfo

Returns

object

Ln(object?, CultureInfo)

public static object Ln(object? a, CultureInfo cultureInfo)

Parameters

a object
cultureInfo CultureInfo

Returns

object

Log(object?, object?, CultureInfo)

public static object Log(object? a, object? b, CultureInfo cultureInfo)

Parameters

a object
b object
cultureInfo CultureInfo

Returns

object

Log10(object?, CultureInfo)

public static object Log10(object? a, CultureInfo cultureInfo)

Parameters

a object
cultureInfo CultureInfo

Returns

object

Max(object?, object?, MathOptions, CultureInfo)

public static object? Max(object? a, object? b, MathOptions options, CultureInfo cultureInfo)

Parameters

a object
b object
options MathOptions
cultureInfo CultureInfo

Returns

object

Min(object?, object?, MathOptions, CultureInfo)

public static object? Min(object? a, object? b, MathOptions options, CultureInfo cultureInfo)

Parameters

a object
b object
options MathOptions
cultureInfo CultureInfo

Returns

object

Modulo(object?, object?, MathOptions, CultureInfo)

public static object? Modulo(object? a, object? b, MathOptions options, CultureInfo cultureInfo)

Parameters

a object
b object
options MathOptions
cultureInfo CultureInfo

Returns

object

Multiply(object?, object?, MathOptions, CultureInfo)

public static object? Multiply(object? a, object? b, MathOptions options, CultureInfo cultureInfo)

Parameters

a object
b object
options MathOptions
cultureInfo CultureInfo

Returns

object

Pow(decimal, decimal)

Raises a decimal to a power. An integral exponent is computed by squaring in decimal arithmetic, so the cost is logarithmic in the exponent and a result outside the decimal range throws an OverflowException as soon as it is reached. Every intermediate product is a smaller power of the same base, so the result is exact whenever the exact power fits in a decimal. Zero raised to a negative power is one over zero and throws a DivideByZeroException, like decimal division. A fractional exponent is computed with Pow(double, double).

public static decimal Pow(decimal @base, decimal exponent)

Parameters

base decimal
exponent decimal

Returns

decimal

Pow(object?, object?, MathOptions, CultureInfo)

public static object Pow(object? a, object? b, MathOptions options, CultureInfo cultureInfo)

Parameters

a object
b object
options MathOptions
cultureInfo CultureInfo

Returns

object

Round(object?, object?, MidpointRounding, MathOptions, CultureInfo)

public static object Round(object? a, object? b, MidpointRounding rounding, MathOptions options, CultureInfo cultureInfo)

Parameters

a object
b object
rounding MidpointRounding
options MathOptions
cultureInfo CultureInfo

Returns

object

Sign(object?, MathOptions, CultureInfo)

public static object Sign(object? a, MathOptions options, CultureInfo cultureInfo)

Parameters

a object
options MathOptions
cultureInfo CultureInfo

Returns

object

Sin(object?, CultureInfo)

public static object Sin(object? a, CultureInfo cultureInfo)

Parameters

a object
cultureInfo CultureInfo

Returns

object

Sqrt(object?, CultureInfo)

public static object Sqrt(object? a, CultureInfo cultureInfo)

Parameters

a object
cultureInfo CultureInfo

Returns

object

Subtract(object?, object?, MathOptions, CultureInfo)

public static object? Subtract(object? a, object? b, MathOptions options, CultureInfo cultureInfo)

Parameters

a object
b object
options MathOptions
cultureInfo CultureInfo

Returns

object

Tan(object?, CultureInfo)

public static object Tan(object? a, CultureInfo cultureInfo)

Parameters

a object
cultureInfo CultureInfo

Returns

object

Truncate(object?, MathOptions, CultureInfo)

public static object Truncate(object? a, MathOptions options, CultureInfo cultureInfo)

Parameters

a object
options MathOptions
cultureInfo CultureInfo

Returns

object

Search NCalc

Find guides, language features, and API symbols.