Class MathHelper
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
aobjectoptionsMathHelperOptions
Returns
Acos(object?, MathHelperOptions)
public static object Acos(object? a, MathHelperOptions options)
Parameters
aobjectoptionsMathHelperOptions
Returns
Add(BigDecimal, object)
public static BigDecimal Add(BigDecimal a, object b)
Parameters
aBigDecimalbobject
Returns
- BigDecimal
Add(BigInteger, BigDecimal)
public static BigDecimal Add(BigInteger a, BigDecimal b)
Parameters
aBigIntegerbBigDecimal
Returns
- BigDecimal
Add(BigInteger, object)
public static BigInteger Add(BigInteger a, object b)
Parameters
aBigIntegerbobject
Returns
Add(object?, object?, bool, MathHelperOptions)
public static object? Add(object? a, object? b, bool reduceTypes, MathHelperOptions options)
Parameters
aobjectbobjectreduceTypesbooloptionsMathHelperOptions
Returns
AddPercent(object?, object?)
public static object? AddPercent(object? a, object? b)
Parameters
Returns
AddPercent(object?, object?, MathHelperOptions)
public static object? AddPercent(object? a, object? b, MathHelperOptions options)
Parameters
aobjectbobjectoptionsMathHelperOptions
Returns
Asin(object?, MathHelperOptions)
public static object Asin(object? a, MathHelperOptions options)
Parameters
aobjectoptionsMathHelperOptions
Returns
Atan(object?, MathHelperOptions)
public static object Atan(object? a, MathHelperOptions options)
Parameters
aobjectoptionsMathHelperOptions
Returns
Atan2(object?, object?, MathHelperOptions)
public static object Atan2(object? a, object? b, MathHelperOptions options)
Parameters
aobjectbobjectoptionsMathHelperOptions
Returns
BitwiseAnd(object?, object?)
public static BigInteger? BitwiseAnd(object? a, object? b)
Parameters
Returns
BitwiseNot(object?)
public static BigInteger? BitwiseNot(object? a)
Parameters
aobject
Returns
BitwiseOr(object?, object?)
public static BigInteger? BitwiseOr(object? a, object? b)
Parameters
Returns
BitwiseXOr(object?, object?)
public static BigInteger? BitwiseXOr(object? a, object? b)
Parameters
Returns
Cbrt(object?, MathHelperOptions)
public static object? Cbrt(object? a, MathHelperOptions options)
Parameters
aobjectoptionsMathHelperOptions
Returns
Ceiling(object?, MathHelperOptions)
public static object Ceiling(object? a, MathHelperOptions options)
Parameters
aobjectoptionsMathHelperOptions
Returns
ConvertToBigDecimal(object)
public static BigDecimal ConvertToBigDecimal(object a)
Parameters
aobject
Returns
- BigDecimal
ConvertToBigInteger(object)
public static BigInteger ConvertToBigInteger(object a)
Parameters
aobject
Returns
ConvertToDecimal(object?, MathHelperOptions)
public static decimal ConvertToDecimal(object? value, MathHelperOptions options)
Parameters
valueobjectoptionsMathHelperOptions
Returns
ConvertToDouble(object?, MathHelperOptions)
public static double ConvertToDouble(object? value, MathHelperOptions options)
Parameters
valueobjectoptionsMathHelperOptions
Returns
ConvertToInt(object?, MathHelperOptions)
public static int ConvertToInt(object? value, MathHelperOptions options)
Parameters
valueobjectoptionsMathHelperOptions
Returns
ConvertToLong(object?, MathHelperOptions)
public static long ConvertToLong(object? value, MathHelperOptions options)
Parameters
valueobjectoptionsMathHelperOptions
Returns
Cos(object?, MathHelperOptions)
public static object Cos(object? a, MathHelperOptions options)
Parameters
aobjectoptionsMathHelperOptions
Returns
Cot(object?, MathHelperOptions)
public static object Cot(object? a, MathHelperOptions options)
Parameters
aobjectoptionsMathHelperOptions
Returns
Divide(BigDecimal, object)
public static BigDecimal Divide(BigDecimal a, object b)
Parameters
aBigDecimalbobject
Returns
- BigDecimal
Divide(object, BigDecimal)
public static BigDecimal Divide(object a, BigDecimal b)
Parameters
aobjectbBigDecimal
Returns
- BigDecimal
Divide(object, BigInteger)
public static BigInteger Divide(object a, BigInteger b)
Parameters
aobjectbBigInteger
Returns
Divide(object?, object?, bool, MathHelperOptions)
public static object? Divide(object? a, object? b, bool reduceTypes, MathHelperOptions options)
Parameters
aobjectbobjectreduceTypesbooloptionsMathHelperOptions
Returns
DividePercent(object?, object?, MathHelperOptions)
public static object? DividePercent(object? a, object? b, MathHelperOptions options)
Parameters
aobjectbobjectoptionsMathHelperOptions
Returns
Exp(object?, MathHelperOptions)
public static object Exp(object? a, MathHelperOptions options)
Parameters
aobjectoptionsMathHelperOptions
Returns
Factorial(long, long, MathHelperOptions)
public static long Factorial(long a, long b, MathHelperOptions options)
Parameters
alongblongoptionsMathHelperOptions
Returns
Factorial(object, object, MathHelperOptions)
public static object Factorial(object a, object b, MathHelperOptions options)
Parameters
aobjectbobjectoptionsMathHelperOptions
Returns
Floor(object?, MathHelperOptions)
public static object Floor(object? a, MathHelperOptions options)
Parameters
aobjectoptionsMathHelperOptions
Returns
Fthrt(object?, MathHelperOptions)
public static object? Fthrt(object? a, MathHelperOptions options)
Parameters
aobjectoptionsMathHelperOptions
Returns
IEEERemainder(object?, object?, MathHelperOptions)
public static object IEEERemainder(object? a, object? b, MathHelperOptions options)
Parameters
aobjectbobjectoptionsMathHelperOptions
Returns
IntegerDivide(BigDecimal, object)
public static BigInteger IntegerDivide(BigDecimal a, object b)
Parameters
aBigDecimalbobject
Returns
IntegerDivide(BigInteger, object)
public static BigInteger IntegerDivide(BigInteger a, object b)
Parameters
aBigIntegerbobject
Returns
IntegerDivide(object, BigDecimal)
public static BigInteger IntegerDivide(object a, BigDecimal b)
Parameters
aobjectbBigDecimal
Returns
IntegerDivide(object, BigInteger)
public static BigInteger IntegerDivide(object a, BigInteger b)
Parameters
aobjectbBigInteger
Returns
IntegerDivide(object?, object?, bool, bool, MathHelperOptions)
public static object? IntegerDivide(object? a, object? b, bool truncateFirst, bool reduceTypes, MathHelperOptions options)
Parameters
aobjectbobjecttruncateFirstboolreduceTypesbooloptionsMathHelperOptions
Returns
IsBoxedIntegerNumber(object?)
public static bool IsBoxedIntegerNumber(object? obj)
Parameters
objobject
Returns
IsBoxedIntegerNumberOrBigNumber(object?)
public static bool IsBoxedIntegerNumberOrBigNumber(object? obj)
Parameters
objobject
Returns
IsBoxedNumber(object?)
public static bool IsBoxedNumber(object? obj)
Parameters
objobject
Returns
IsBoxedNumberOne(object?)
public static bool IsBoxedNumberOne(object? number)
Parameters
numberobject
Returns
IsBoxedNumberOrBigNumber(object?)
public static bool IsBoxedNumberOrBigNumber(object? obj)
Parameters
objobject
Returns
IsBoxedNumberZero(object?)
public static bool IsBoxedNumberZero(object? number)
Parameters
numberobject
Returns
LeftShift(BigInteger, object?, MathHelperOptions)
public static BigInteger? LeftShift(BigInteger a, object? b, MathHelperOptions options)
Parameters
aBigIntegerbobjectoptionsMathHelperOptions
Returns
Ln(object?, MathHelperOptions)
public static object Ln(object? a, MathHelperOptions options)
Parameters
aobjectoptionsMathHelperOptions
Returns
Log(object?, object?, MathHelperOptions)
public static object Log(object? a, object? b, MathHelperOptions options)
Parameters
aobjectbobjectoptionsMathHelperOptions
Returns
Log10(object?, MathHelperOptions)
public static object Log10(object? a, MathHelperOptions options)
Parameters
aobjectoptionsMathHelperOptions
Returns
Log2(object?, MathHelperOptions)
public static object Log2(object? a, MathHelperOptions options)
Parameters
aobjectoptionsMathHelperOptions
Returns
Max(object, BigDecimal)
public static object Max(object a, BigDecimal b)
Parameters
aobjectbBigDecimal
Returns
Max(object, BigInteger)
public static object Max(object a, BigInteger b)
Parameters
aobjectbBigInteger
Returns
Max(object?, object?, MathHelperOptions)
public static object? Max(object? a, object? b, MathHelperOptions options)
Parameters
aobjectbobjectoptionsMathHelperOptions
Returns
Min(object, BigDecimal)
public static object Min(object a, BigDecimal b)
Parameters
aobjectbBigDecimal
Returns
Min(object, BigInteger)
public static object Min(object a, BigInteger b)
Parameters
aobjectbBigInteger
Returns
Min(object?, object?, MathHelperOptions)
public static object? Min(object? a, object? b, MathHelperOptions options)
Parameters
aobjectbobjectoptionsMathHelperOptions
Returns
Modulo(object?, object?, bool, MathHelperOptions)
public static object? Modulo(object? a, object? b, bool reduceTypes, MathHelperOptions options)
Parameters
aobjectbobjectreduceTypesbooloptionsMathHelperOptions
Returns
Multiply(BigDecimal, object)
public static BigDecimal Multiply(BigDecimal a, object b)
Parameters
aBigDecimalbobject
Returns
- BigDecimal
Multiply(BigInteger, BigDecimal)
public static BigDecimal Multiply(BigInteger a, BigDecimal b)
Parameters
aBigIntegerbBigDecimal
Returns
- BigDecimal
Multiply(BigInteger, object)
public static BigInteger Multiply(BigInteger a, object b)
Parameters
aBigIntegerbobject
Returns
Multiply(object?, object?, bool, MathHelperOptions)
public static object? Multiply(object? a, object? b, bool reduceTypes, MathHelperOptions options)
Parameters
aobjectbobjectreduceTypesbooloptionsMathHelperOptions
Returns
MultiplyPercent(object?, object?)
public static object? MultiplyPercent(object? a, object? b)
Parameters
Returns
MultiplyPercent(object?, object?, MathHelperOptions)
public static object? MultiplyPercent(object? a, object? b, MathHelperOptions options)
Parameters
aobjectbobjectoptionsMathHelperOptions
Returns
Pow(object?, object?, bool, MathHelperOptions)
public static object Pow(object? a, object? b, bool reduceTypes, MathHelperOptions options)
Parameters
aobjectbobjectreduceTypesbooloptionsMathHelperOptions
Returns
ReduceNumericType(object, bool, MathHelperOptions)
public static object? ReduceNumericType(object value, bool forceInteger = false, MathHelperOptions options = default)
Parameters
valueobjectforceIntegerbooloptionsMathHelperOptions
Returns
ReduceToSaneNumber(BigDecimal, bool, MathHelperOptions?)
public static object? ReduceToSaneNumber(BigDecimal value, bool forceInteger = false, MathHelperOptions? options = null)
Parameters
valueBigDecimalforceIntegerbooloptionsMathHelperOptions?
Returns
ReduceToSaneNumber(BigInteger, MathHelperOptions?)
public static object? ReduceToSaneNumber(BigInteger value, MathHelperOptions? options = null)
Parameters
valueBigIntegeroptionsMathHelperOptions?
Returns
RightShift(BigInteger, object?, MathHelperOptions)
public static BigInteger? RightShift(BigInteger a, object? b, MathHelperOptions options)
Parameters
aBigIntegerbobjectoptionsMathHelperOptions
Returns
Round(object?, object?, MidpointRounding, MathHelperOptions)
public static object Round(object? a, object? b, MidpointRounding rounding, MathHelperOptions options)
Parameters
aobjectbobjectroundingMidpointRoundingoptionsMathHelperOptions
Returns
Sign(object?, MathHelperOptions)
public static object Sign(object? a, MathHelperOptions options)
Parameters
aobjectoptionsMathHelperOptions
Returns
Sin(object?, MathHelperOptions)
public static object Sin(object? a, MathHelperOptions options)
Parameters
aobjectoptionsMathHelperOptions
Returns
Sqrt(object?, MathHelperOptions)
public static object? Sqrt(object? a, MathHelperOptions options)
Parameters
aobjectoptionsMathHelperOptions
Returns
Subtract(BigDecimal, object)
public static BigDecimal Subtract(BigDecimal a, object b)
Parameters
aBigDecimalbobject
Returns
- BigDecimal
Subtract(BigInteger, object)
public static BigInteger Subtract(BigInteger a, object b)
Parameters
aBigIntegerbobject
Returns
Subtract(object, BigDecimal)
public static BigDecimal Subtract(object a, BigDecimal b)
Parameters
aobjectbBigDecimal
Returns
- BigDecimal
Subtract(object, BigInteger)
public static BigInteger Subtract(object a, BigInteger b)
Parameters
aobjectbBigInteger
Returns
Subtract(object?, object?, bool, MathHelperOptions)
public static object? Subtract(object? a, object? b, bool reduceTypes, MathHelperOptions options)
Parameters
aobjectbobjectreduceTypesbooloptionsMathHelperOptions
Returns
SubtractPercent(object?, object?)
public static object? SubtractPercent(object? a, object? b)
Parameters
Returns
SubtractPercent(object?, object?, MathHelperOptions)
public static object? SubtractPercent(object? a, object? b, MathHelperOptions options)
Parameters
aobjectbobjectoptionsMathHelperOptions
Returns
Tan(object?, MathHelperOptions)
public static object Tan(object? a, MathHelperOptions options)
Parameters
aobjectoptionsMathHelperOptions
Returns
Truncate(object?, MathHelperOptions)
public static object Truncate(object? a, MathHelperOptions options)
Parameters
aobjectoptionsMathHelperOptions
Returns
TryReduceToUInt64(BigInteger?)
public static object? TryReduceToUInt64(BigInteger? value)
Parameters
valueBigInteger?