Operations<T> Class

Represents the arithmetic and other operations for an operand type.

Definition

Namespace: Numerics.NET
Assembly: Numerics.NET (in Numerics.NET.dll) Version: 9.0.4
C#
public static class Operations<T>
Inheritance
Object  →  Operations<T>

Type Parameters

T
The operand type.

Remarks

Use the Operations<T> class to perform operations on operand types that are generic type parameters.

Most operations are implemented as fields that contain delegates that perform the operation. This gives the best performance. When an operation can have several overloads, methods that wrap private fields are used instead.

For primitive types, the operation is performed directly if it is defined. For other types, operator methods are used if they are available. Otherwise, if an arithmetic type has been declared for the operand type in the type association registry, the operations defined by that arithmetic type are used.

Properties

Comparer Gets the comparer for the operand type.
E Gets the value of e, the base of the natural logarithm.
Epsilon Gets the machine precision of the operand type.
IsInteger Gets whether the number type represents integers.
IsReal Gets whether the number type represents real numbers.
MaxValue Gets the largest finite value of the numeric type.
MinPositiveValue Gets the smallest value that is greater than zero.
MinusOne Returns the value of -1 as an instance of the number type.
MinValue Gets the smallest finite value of the numeric type.
MissingValue Gets the missing value for the operand type.
NaN Gets the Not-a-Number value for the operand type.
NegativeInfinity Gets the value of negative infinity for the operand type.
One Returns the value of 1 as an instance of the number type.
Pi Gets the value of π.
PiOverTwo Gets the value of π/2.
PositiveInfinity Gets the value of positive infinity for the operand type.
SupportsIeee type.
Zero Returns the value of zero as an instance of the number type.

Methods

Abs Returns the absolute value of a number.
Acos Returns the angle whose cosine is the specified number.
Acosh Returns the inverse hyperbolic cosine of a real number.
Add Returns the sum of two numbers.
AddProduct Adds a number and the product of two other numbers.
And Returns the logical or bitwise and of two numbers.
Asin Returns the angle whose sine is the specified number.
Asinh Returns the inverse hyperbolic sine of a real number.
Atan Returns the angle whose tangent is the specified number.
Atan2 specified coordinates.
Atanh Returns the inverse hyperbolic tangent of a real number.
Cbrt Returns the square root of a number.
Ceiling number.
Clamp Returns a number clamped by a maximum and minimum value.
Compare Compares two values.
Conjugate Returns the conjugate of a complex number.
ConjugateMultiply Multiplies the conjugate of a number by another number.
ConvertTo<U>(T) Converts an instance of the operand type to the specified type.
ConvertTo<U>(T, T, U) Converts an instance of the operand type to the specified type.
Copy Returns a copy of a number.
Cos Returns the cosine of a number.
Cosh Returns the hyperbolic cosine of a number.
Divide Divides two numbers.
EqualTo Returns whether two numbers are equal.
Exp Returns the exponential of a number.
Exp10 Returns the exponential of a number.
Exp2 Returns the exponential of a number.
ExpM1 Returns the exponential of a number, minus 1.
ExpMinus1 Returns the exponential of a number, minus 1.
Floor Returns the largest integer less than or equal to a number.
FromDouble Converts an integer to an instance of the operand type.
FromInt32 Converts an integer to an instance of the operand type.
GreaterThan Returns if one number is greater than another.
GreaterThanOrEqual Returns if one number is greater than or equal to another.
Hypot with sides of specified length.
IsFinite Returns whether a number is a finite number.
IsMissing Returns whether a value represents a missing value.
IsNaN Returns whether a number is Not-a-Number.
IsNegativeInfinity Returns whether a number equals negative infinity.
IsOne Returns whether a number equals one.
IsPositiveInfinity Returns whether a number equals positive infinity.
IsZero Returns whether a number equals zero.
LeftShift Shifts a value the specified number of bits to the left.
LessThan Returns if one number is less than another.
LessThanOrEqual Returns if one number is less than or equal to another.
Log(T) Returns the natural logarithm of a number.
Log(T, T) Returns the natural logarithm of a number.
Log10 Returns the base 10 logarithm of a number.
Log1p Returns the logarithm of 1 plus the argument.
Log1PlusX Returns the logarithm of 1 plus the argument.
Log2 Returns the base 2 logarithm of a number.
Max Returns the largest of two numbers, returning NaN when either value is NaN.
MaxNumber Returns the largest of two numbers, returning NaN only when both value are NaN.
Min Returns the smallest of two numbers, returning NaN when either value is NaN.
MinNumber Returns the smallest of two numbers, returning NaN only when both value are NaN.
Modulus Returns the remainder after dividing two numbers.
Multiply Returns the product of two numbers.
MultiplySum Multiplies a number and the sum of two other numbers.
Negate Reverses the sign of a number.
Not Returns the logical or bitwise complement of two numbers.
NotEqualTo Returns whether two numbers are equal.
OneNorm and imaginary parts of a complex number.
Or Returns the logical or bitwise or of two numbers.
Pow(T, T) Raises a number to the specified power.
Pow(T, Int32) Raises a number to the specified power.
Reciprocal Returns the reciprocal of a number.
Remainder Returns the remainder after dividing two numbers.
RightShift Shifts a value the specified number of bits to the right.
RootN Returns the square root of a number.
Round(T) Rounds a number to the specified number to the nearest integer.
Round(T, Int32) Rounds a number to the specified number of decimal digits.
Same Returns whether two numbers are equal.
ScaleByPowerOfTwo Multiplies a value by a power of two.
Sign Returns the sign of the specified number.
Sin Returns the sine of a number.
SinCos Returns a tuple of the sine and cosine of a number.
Sinh Returns the hyperbolic sine of a number.
Sqrt Returns the cube root of a number.
Subtract Subtracts one number from another.
Tan Returns the tangent of the specified angle.
Tanh Returns the hyperbolic tangent of the specified angle.
ToInt32 Converts an instance of the operand type to an integer.
Truncate Returns the largest integer less than or equal to a number.
Xor Returns the logical or bitwise exclusive or of two numbers.

Fields

EqualityComparer Gets the default equality comparer for the operand type.
HasMissingValueRepresentation Gets whether the type has a value that can represent missing values.
IsOrdered Gets whether the operand type supports comparison.

See Also