Class Numerics
- Namespace
- NUnit.Framework.Constraints
- Assembly
- nunit.framework.dll
The Numerics class contains common operations on numeric _values.
public class Numerics
- Inheritance
-
Numerics
- Inherited Members
Methods
AreEqual(object, object, ref Tolerance)
Test two numeric _values for equality, performing the usual numeric conversions and using a provided or default tolerance. If the tolerance provided is Empty, this method may set it to a default tolerance.
public static bool AreEqual(object expected, object actual, ref Tolerance tolerance)
Parameters
expected
objectThe expected value
actual
objectThe actual value
tolerance
ToleranceA reference to the tolerance in effect
Returns
- bool
True if the _values are equal
Compare(object, object)
Compare two numeric _values, performing the usual numeric conversions.
public static int Compare(object expected, object actual)
Parameters
Returns
- int
The relationship of the _values to each other
IsFixedPointNumeric(object)
Checks the type of the object, returning true if the object is a fixed point numeric type.
public static bool IsFixedPointNumeric(object obj)
Parameters
obj
objectThe object to check
Returns
- bool
true if the object is a fixed point numeric type
IsFloatingPointNumeric(object)
Checks the type of the object, returning true if the object is a floating point numeric type.
public static bool IsFloatingPointNumeric(object obj)
Parameters
obj
objectThe object to check
Returns
- bool
true if the object is a floating point numeric type
IsNumericType(object)
Checks the type of the object, returning true if the object is a numeric type.
public static bool IsNumericType(object obj)
Parameters
obj
objectThe object to check
Returns
- bool
true if the object is a numeric type