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#
Assembly: Numerics.NET (in Numerics.NET.dll) Version: 9.0.4
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. |
Max | Gets the largest finite value of the numeric type. |
Min | Gets the smallest value that is greater than zero. |
Minus | Returns the value of -1 as an instance of the number type. |
Min | Gets the smallest finite value of the numeric type. |
Missing | Gets the missing value for the operand type. |
NaN | Gets the Not-a-Number value for the operand type. |
Negative | 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 π. |
PiOver | Gets the value of π/2. |
Positive | Gets the value of positive infinity for the operand type. |
Supports | 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. |
Add | 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. |
Conjugate | Multiplies the conjugate of a number by another number. |
Convert | Converts an instance of the operand type to the specified type. |
Convert | 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. |
Equal | 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. |
Exp | Returns the exponential of a number, minus 1. |
Exp | Returns the exponential of a number, minus 1. |
Floor | Returns the largest integer less than or equal to a number. |
From | Converts an integer to an instance of the operand type. |
From | Converts an integer to an instance of the operand type. |
Greater | Returns if one number is greater than another. |
Greater | 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. |
IsNa | Returns whether a number is Not-a-Number. |
IsNegative | Returns whether a number equals negative infinity. |
IsOne | Returns whether a number equals one. |
IsPositive | Returns whether a number equals positive infinity. |
IsZero | Returns whether a number equals zero. |
Left | Shifts a value the specified number of bits to the left. |
Less | Returns if one number is less than another. |
Less | Returns if one number is less than or equal to another. |
Log( | Returns the natural logarithm of a number. |
Log( | 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. |
Log1Plus | 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. |
Max | 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. |
Min | 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. |
Multiply | 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. |
Not | Returns whether two numbers are equal. |
One | and imaginary parts of a complex number. |
Or | Returns the logical or bitwise or of two numbers. |
Pow( | Raises a number to the specified power. |
Pow( | Raises a number to the specified power. |
Reciprocal | Returns the reciprocal of a number. |
Remainder | Returns the remainder after dividing two numbers. |
Right | Shifts a value the specified number of bits to the right. |
Root | Returns the square root of a number. |
Round( | Rounds a number to the specified number to the nearest integer. |
Round( | Rounds a number to the specified number of decimal digits. |
Same | Returns whether two numbers are equal. |
Scale | Multiplies a value by a power of two. |
Sign | Returns the sign of the specified number. |
Sin | Returns the sine of a number. |
Sin | 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
Equality | Gets the default equality comparer for the operand type. |
Has | Gets whether the type has a value that can represent missing values. |
IsOrdered | Gets whether the operand type supports comparison. |