MathNRoundTNumeric(TNumeric) Method
Rounds a value to the nearest integral value, and rounds midpoint values to the nearest even number.
Namespace: Jodosoft.NumericsAssembly: Jodosoft.Numerics (in Jodosoft.Numerics.dll) Version: 2.0
public static TNumeric Round<TNumeric>(
TNumeric x
)
where TNumeric : struct, new(), INumeric<TNumeric>
Public Shared Function Round(Of TNumeric As {Structure, New, INumeric(Of TNumeric)}) (
x As TNumeric
) As TNumeric
public:
generic<typename TNumeric>
where TNumeric : value class, gcnew(), INumeric<TNumeric>
static TNumeric Round(
TNumeric x
)
static member Round :
x : 'TNumeric -> 'TNumeric when 'TNumeric : struct, new() and INumeric<'TNumeric>
- x TNumeric
- A number to be rounded.
- TNumeric
TNumeric
The integer nearest the
x parameter.
If the fractional component of
x is halfway between two integers,
one of which is even and the other odd, the even number is returned.
This method may return
NaN or Infinity.
If
NaN or Infinity cannot be represented by
TNumeric,
then this method may throw an
ArithmeticException.