Arithmetic
This static class collects and maintains all arithmetic operators.
Methods
Abs
#Acos
#Acot
#Acsc
#AddRepository
#Copy all functionality from an ArithmeticRepository into the global server.
Returns: True if repo was added.
Apply
#Attempt to run a known operator on two values. This method is the recommended one for arithmetic operations, as it will first attempt the operation on type defined operator overloads.
Returns: Result of Function(a), or an Exception if the function is undefined. Note that this method will return rather than throw that exception, allowing the caller to differenciate between exceptions arising from unrecognised operations and those from the operation implementations.
Apply
#Attempt to run a known operator on two values. Note that null values will act as identities. If you wish to have coalescing nulls you must check for that yourself. Also, in case it wasn't horribly obvious, this is MUCH slower than just calling the appropriate operator on values directly. Only use this method if you have no way of knowing at compile time what types your arguments are.
Apply
#Attempt to run a known operator on two values. This method is the recommended one for arithmetic operations, as it will first attempt the operation on type defined operator overloads.
Returns: Result of Function(a, b), or an Exception if the function is undefined. Note that this method will return rather than throw that exception, allowing the caller to differenciate between exceptions arising from unrecognised operations and those from the operation implementations.
Apply
#Try and apply the given function to an argument.
Returns: Result of Function(a), or an Exception if the function is undefined. Note that this method will return rather than throw that exception, allowing the caller to differenciate between exceptions arising from unrecognised operations and those from the operation implementations.
ApplyBulk
#Apply a binary function to two trees.
public static ITree ApplyBulk()
fn,
Function to apply.
a,
First tree.
b,
Second tree.
token
Cancellation token.
Returns: Resulting values.
ApplyBulk
#Apply an operation to two trees.
public static ITree ApplyBulk()
op,
Operation to apply.
a,
First tree.
b,
Second tree.
token
Cancellation token.
Returns: Resulting values.
ApplyBulk
#Apply a uniary function to a tree.
Returns: Resulting values.
Asec
#Asin
#Atan
#Cbrt
#Ceiling
#Cos
#Cot
#Csc
#Div
#Exp
#Floor
#Format
#Gets the notational format for the given binary function. The format will include '{0}' and '{1}' fields for the arguments.
Format
#Gets the notational format for the given arithmetic operator. The format will include '{0}' and '{1}' fields for the operands.
Format
#Gets the notational format for the given ternary function. The format will include '{0}', '{1}' and '{2}' fields for the arguments.
Format
#Gets the notational format for the given unary function. The format will include a '{0}' fields for the argument.
Log
#Log10
#Log2
#Max
#Min
#MulFloatInteger
#A multiplication method for double and BigIntegers, which operates entirely within the BigInteger range.
Multiple
#Pow
#Round
#Sec
#Sign
#Sin
#SmartIntegerDivision
#Perform clever integer division which always reverts to the most appropriate output type.
public static bool SmartIntegerDivision()
numerator,
Numerator of either int or BigInteger.
denominator,
Denominator of either int or BigInteger.
out object
result
Either a double, int or BigInteger depending on the input values.
Returns: True if an integer division was performed.
SmartIntegerDivision
#Perform clever integer division which always reverts to the most appropriate output type.
public static object SmartIntegerDivision()
Returns: Result of smart integer division or floating point division.