Table of Contents

Class MathHelper

Namespace
NCalc.Helpers
Assembly
NCalc.dll

Utilities for doing mathematical operations between different object types.

public static class MathHelper
Inheritance
MathHelper
Inherited Members

Methods

Abs(object?, MathHelperOptions)

public static object Abs(object? a, MathHelperOptions options)

Parameters

a object
options MathHelperOptions

Returns

object

Acos(object?, MathHelperOptions)

public static object Acos(object? a, MathHelperOptions options)

Parameters

a object
options MathHelperOptions

Returns

object

Add(BigDecimal, object)

public static BigDecimal Add(BigDecimal a, object b)

Parameters

a BigDecimal
b object

Returns

BigDecimal

Add(BigInteger, BigDecimal)

public static BigDecimal Add(BigInteger a, BigDecimal b)

Parameters

a BigInteger
b BigDecimal

Returns

BigDecimal

Add(BigInteger, object)

public static BigInteger Add(BigInteger a, object b)

Parameters

a BigInteger
b object

Returns

BigInteger

Add(object?, object?, bool, MathHelperOptions)

public static object? Add(object? a, object? b, bool reduceTypes, MathHelperOptions options)

Parameters

a object
b object
reduceTypes bool
options MathHelperOptions

Returns

object

AddPercent(object?, object?)

public static object? AddPercent(object? a, object? b)

Parameters

a object
b object

Returns

object

AddPercent(object?, object?, MathHelperOptions)

public static object? AddPercent(object? a, object? b, MathHelperOptions options)

Parameters

a object
b object
options MathHelperOptions

Returns

object

Asin(object?, MathHelperOptions)

public static object Asin(object? a, MathHelperOptions options)

Parameters

a object
options MathHelperOptions

Returns

object

Atan(object?, MathHelperOptions)

public static object Atan(object? a, MathHelperOptions options)

Parameters

a object
options MathHelperOptions

Returns

object

Atan2(object?, object?, MathHelperOptions)

public static object Atan2(object? a, object? b, MathHelperOptions options)

Parameters

a object
b object
options MathHelperOptions

Returns

object

BitwiseAnd(object?, object?)

public static BigInteger? BitwiseAnd(object? a, object? b)

Parameters

a object
b object

Returns

BigInteger?

BitwiseNot(object?)

public static BigInteger? BitwiseNot(object? a)

Parameters

a object

Returns

BigInteger?

BitwiseOr(object?, object?)

public static BigInteger? BitwiseOr(object? a, object? b)

Parameters

a object
b object

Returns

BigInteger?

BitwiseXOr(object?, object?)

public static BigInteger? BitwiseXOr(object? a, object? b)

Parameters

a object
b object

Returns

BigInteger?

Cbrt(object?, MathHelperOptions)

public static object? Cbrt(object? a, MathHelperOptions options)

Parameters

a object
options MathHelperOptions

Returns

object

Ceiling(object?, MathHelperOptions)

public static object Ceiling(object? a, MathHelperOptions options)

Parameters

a object
options MathHelperOptions

Returns

object

ConvertToBigDecimal(object)

public static BigDecimal ConvertToBigDecimal(object a)

Parameters

a object

Returns

BigDecimal

ConvertToBigInteger(object)

public static BigInteger ConvertToBigInteger(object a)

Parameters

a object

Returns

BigInteger

ConvertToDecimal(object?, MathHelperOptions)

public static decimal ConvertToDecimal(object? value, MathHelperOptions options)

Parameters

value object
options MathHelperOptions

Returns

decimal

ConvertToDouble(object?, MathHelperOptions)

public static double ConvertToDouble(object? value, MathHelperOptions options)

Parameters

value object
options MathHelperOptions

Returns

double

ConvertToInt(object?, MathHelperOptions)

public static int ConvertToInt(object? value, MathHelperOptions options)

Parameters

value object
options MathHelperOptions

Returns

int

ConvertToLong(object?, MathHelperOptions)

public static long ConvertToLong(object? value, MathHelperOptions options)

Parameters

value object
options MathHelperOptions

Returns

long

Cos(object?, MathHelperOptions)

public static object Cos(object? a, MathHelperOptions options)

Parameters

a object
options MathHelperOptions

Returns

object

Cot(object?, MathHelperOptions)

public static object Cot(object? a, MathHelperOptions options)

Parameters

a object
options MathHelperOptions

Returns

object

Divide(BigDecimal, object)

public static BigDecimal Divide(BigDecimal a, object b)

Parameters

a BigDecimal
b object

Returns

BigDecimal

Divide(object, BigDecimal)

public static BigDecimal Divide(object a, BigDecimal b)

Parameters

a object
b BigDecimal

Returns

BigDecimal

Divide(object, BigInteger)

public static BigInteger Divide(object a, BigInteger b)

Parameters

a object
b BigInteger

Returns

BigInteger

Divide(object?, object?, bool, MathHelperOptions)

public static object? Divide(object? a, object? b, bool reduceTypes, MathHelperOptions options)

Parameters

a object
b object
reduceTypes bool
options MathHelperOptions

Returns

object

DividePercent(object?, object?, MathHelperOptions)

public static object? DividePercent(object? a, object? b, MathHelperOptions options)

Parameters

a object
b object
options MathHelperOptions

Returns

object

Exp(object?, MathHelperOptions)

public static object Exp(object? a, MathHelperOptions options)

Parameters

a object
options MathHelperOptions

Returns

object

Factorial(long, long, MathHelperOptions)

public static long Factorial(long a, long b, MathHelperOptions options)

Parameters

a long
b long
options MathHelperOptions

Returns

long

Factorial(object, object, MathHelperOptions)

public static object Factorial(object a, object b, MathHelperOptions options)

Parameters

a object
b object
options MathHelperOptions

Returns

object

Floor(object?, MathHelperOptions)

public static object Floor(object? a, MathHelperOptions options)

Parameters

a object
options MathHelperOptions

Returns

object

Fthrt(object?, MathHelperOptions)

public static object? Fthrt(object? a, MathHelperOptions options)

Parameters

a object
options MathHelperOptions

Returns

object

IEEERemainder(object?, object?, MathHelperOptions)

public static object IEEERemainder(object? a, object? b, MathHelperOptions options)

Parameters

a object
b object
options MathHelperOptions

Returns

object

IntegerDivide(BigDecimal, object)

public static BigInteger IntegerDivide(BigDecimal a, object b)

Parameters

a BigDecimal
b object

Returns

BigInteger

IntegerDivide(BigInteger, object)

public static BigInteger IntegerDivide(BigInteger a, object b)

Parameters

a BigInteger
b object

Returns

BigInteger

IntegerDivide(object, BigDecimal)

public static BigInteger IntegerDivide(object a, BigDecimal b)

Parameters

a object
b BigDecimal

Returns

BigInteger

IntegerDivide(object, BigInteger)

public static BigInteger IntegerDivide(object a, BigInteger b)

Parameters

a object
b BigInteger

Returns

BigInteger

IntegerDivide(object?, object?, bool, bool, MathHelperOptions)

public static object? IntegerDivide(object? a, object? b, bool truncateFirst, bool reduceTypes, MathHelperOptions options)

Parameters

a object
b object
truncateFirst bool
reduceTypes bool
options MathHelperOptions

Returns

object

IsBoxedIntegerNumber(object?)

public static bool IsBoxedIntegerNumber(object? obj)

Parameters

obj object

Returns

bool

IsBoxedIntegerNumberOrBigNumber(object?)

public static bool IsBoxedIntegerNumberOrBigNumber(object? obj)

Parameters

obj object

Returns

bool

IsBoxedNumber(object?)

public static bool IsBoxedNumber(object? obj)

Parameters

obj object

Returns

bool

IsBoxedNumberOne(object?)

public static bool IsBoxedNumberOne(object? number)

Parameters

number object

Returns

bool

IsBoxedNumberOrBigNumber(object?)

public static bool IsBoxedNumberOrBigNumber(object? obj)

Parameters

obj object

Returns

bool

IsBoxedNumberZero(object?)

public static bool IsBoxedNumberZero(object? number)

Parameters

number object

Returns

bool

LeftShift(BigInteger, object?, MathHelperOptions)

public static BigInteger? LeftShift(BigInteger a, object? b, MathHelperOptions options)

Parameters

a BigInteger
b object
options MathHelperOptions

Returns

BigInteger?

Ln(object?, MathHelperOptions)

public static object Ln(object? a, MathHelperOptions options)

Parameters

a object
options MathHelperOptions

Returns

object

Log(object?, object?, MathHelperOptions)

public static object Log(object? a, object? b, MathHelperOptions options)

Parameters

a object
b object
options MathHelperOptions

Returns

object

Log10(object?, MathHelperOptions)

public static object Log10(object? a, MathHelperOptions options)

Parameters

a object
options MathHelperOptions

Returns

object

Log2(object?, MathHelperOptions)

public static object Log2(object? a, MathHelperOptions options)

Parameters

a object
options MathHelperOptions

Returns

object

Max(object, BigDecimal)

public static object Max(object a, BigDecimal b)

Parameters

a object
b BigDecimal

Returns

object

Max(object, BigInteger)

public static object Max(object a, BigInteger b)

Parameters

a object
b BigInteger

Returns

object

Max(object?, object?, MathHelperOptions)

public static object? Max(object? a, object? b, MathHelperOptions options)

Parameters

a object
b object
options MathHelperOptions

Returns

object

Min(object, BigDecimal)

public static object Min(object a, BigDecimal b)

Parameters

a object
b BigDecimal

Returns

object

Min(object, BigInteger)

public static object Min(object a, BigInteger b)

Parameters

a object
b BigInteger

Returns

object

Min(object?, object?, MathHelperOptions)

public static object? Min(object? a, object? b, MathHelperOptions options)

Parameters

a object
b object
options MathHelperOptions

Returns

object

Modulo(object?, object?, bool, MathHelperOptions)

public static object? Modulo(object? a, object? b, bool reduceTypes, MathHelperOptions options)

Parameters

a object
b object
reduceTypes bool
options MathHelperOptions

Returns

object

Multiply(BigDecimal, object)

public static BigDecimal Multiply(BigDecimal a, object b)

Parameters

a BigDecimal
b object

Returns

BigDecimal

Multiply(BigInteger, BigDecimal)

public static BigDecimal Multiply(BigInteger a, BigDecimal b)

Parameters

a BigInteger
b BigDecimal

Returns

BigDecimal

Multiply(BigInteger, object)

public static BigInteger Multiply(BigInteger a, object b)

Parameters

a BigInteger
b object

Returns

BigInteger

Multiply(object?, object?, bool, MathHelperOptions)

public static object? Multiply(object? a, object? b, bool reduceTypes, MathHelperOptions options)

Parameters

a object
b object
reduceTypes bool
options MathHelperOptions

Returns

object

MultiplyPercent(object?, object?)

public static object? MultiplyPercent(object? a, object? b)

Parameters

a object
b object

Returns

object

MultiplyPercent(object?, object?, MathHelperOptions)

public static object? MultiplyPercent(object? a, object? b, MathHelperOptions options)

Parameters

a object
b object
options MathHelperOptions

Returns

object

Pow(object?, object?, bool, MathHelperOptions)

public static object Pow(object? a, object? b, bool reduceTypes, MathHelperOptions options)

Parameters

a object
b object
reduceTypes bool
options MathHelperOptions

Returns

object

ReduceNumericType(object, bool, MathHelperOptions)

public static object? ReduceNumericType(object value, bool forceInteger = false, MathHelperOptions options = default)

Parameters

value object
forceInteger bool
options MathHelperOptions

Returns

object

ReduceToSaneNumber(BigDecimal, bool, MathHelperOptions?)

public static object? ReduceToSaneNumber(BigDecimal value, bool forceInteger = false, MathHelperOptions? options = null)

Parameters

value BigDecimal
forceInteger bool
options MathHelperOptions?

Returns

object

ReduceToSaneNumber(BigInteger, MathHelperOptions?)

public static object? ReduceToSaneNumber(BigInteger value, MathHelperOptions? options = null)

Parameters

value BigInteger
options MathHelperOptions?

Returns

object

RightShift(BigInteger, object?, MathHelperOptions)

public static BigInteger? RightShift(BigInteger a, object? b, MathHelperOptions options)

Parameters

a BigInteger
b object
options MathHelperOptions

Returns

BigInteger?

Round(object?, object?, MidpointRounding, MathHelperOptions)

public static object Round(object? a, object? b, MidpointRounding rounding, MathHelperOptions options)

Parameters

a object
b object
rounding MidpointRounding
options MathHelperOptions

Returns

object

Sign(object?, MathHelperOptions)

public static object Sign(object? a, MathHelperOptions options)

Parameters

a object
options MathHelperOptions

Returns

object

Sin(object?, MathHelperOptions)

public static object Sin(object? a, MathHelperOptions options)

Parameters

a object
options MathHelperOptions

Returns

object

Sqrt(object?, MathHelperOptions)

public static object? Sqrt(object? a, MathHelperOptions options)

Parameters

a object
options MathHelperOptions

Returns

object

Subtract(BigDecimal, object)

public static BigDecimal Subtract(BigDecimal a, object b)

Parameters

a BigDecimal
b object

Returns

BigDecimal

Subtract(BigInteger, object)

public static BigInteger Subtract(BigInteger a, object b)

Parameters

a BigInteger
b object

Returns

BigInteger

Subtract(object, BigDecimal)

public static BigDecimal Subtract(object a, BigDecimal b)

Parameters

a object
b BigDecimal

Returns

BigDecimal

Subtract(object, BigInteger)

public static BigInteger Subtract(object a, BigInteger b)

Parameters

a object
b BigInteger

Returns

BigInteger

Subtract(object?, object?, bool, MathHelperOptions)

public static object? Subtract(object? a, object? b, bool reduceTypes, MathHelperOptions options)

Parameters

a object
b object
reduceTypes bool
options MathHelperOptions

Returns

object

SubtractPercent(object?, object?)

public static object? SubtractPercent(object? a, object? b)

Parameters

a object
b object

Returns

object

SubtractPercent(object?, object?, MathHelperOptions)

public static object? SubtractPercent(object? a, object? b, MathHelperOptions options)

Parameters

a object
b object
options MathHelperOptions

Returns

object

Tan(object?, MathHelperOptions)

public static object Tan(object? a, MathHelperOptions options)

Parameters

a object
options MathHelperOptions

Returns

object

Truncate(object?, MathHelperOptions)

public static object Truncate(object? a, MathHelperOptions options)

Parameters

a object
options MathHelperOptions

Returns

object

TryReduceToUInt64(BigInteger?)

public static object? TryReduceToUInt64(BigInteger? value)

Parameters

value BigInteger?

Returns

object