Big Float.Round Method
Definition
Namespace: Numerics.NET
Assembly: Numerics.NET (in Numerics.NET.dll) Version: 9.0.3
Assembly: Numerics.NET (in Numerics.NET.dll) Version: 9.0.3
Overload List
Round( | Rounds a BigFloat value to the nearest integer. |
Round( | Rounds a BigFloat value to the specified number of decimal digits. |
Round( | Rounds a BigFloat value to the specified number of decimal digits. |
Round( | Rounds a value to a specified number of fractional digits using the specified rounding mode. |
Round(BigFloat)
Rounds a BigFloat value to the nearest integer.
public static BigFloat Round(
BigFloat value
)
Parameters
Return Value
BigFloatThe BigFloat value that equals the integer closest to value.
Implements
IFloatingPoint<TSelf>.Round(TSelf)Exceptions
Argument | value is null. |
Round(BigFloat, Int32)
Rounds a BigFloat value to the specified number of decimal digits.
public static BigFloat Round(
BigFloat value,
int digits
)
Parameters
Return Value
BigFloatThe BigFloat value with digits digits after the decimal point that is closest to value.
Implements
IFloatingPoint<TSelf>.Round(TSelf, Int32)Remarks
If digits is negative, then the result is an integer that is a multiple of a power of ten. Results are rounded towards zero.
Exceptions
Argument | value is null. |
Round(BigFloat, Int32, RoundingMode)
Rounds a BigFloat value to the specified number of decimal digits.
public static BigFloat Round(
BigFloat value,
int decimals,
RoundingMode roundingMode
)
Parameters
- value BigFloat
- A BigFloat value.
- decimals Int32
- The number of decimal digits.
- roundingMode RoundingMode
- The rounding mode.
Return Value
BigFloatThe BigFloat value with decimals digits after the decimal point that is closest to value.
Remarks
If decimals is negative, then the result is an integer that is a multiple of a power of ten. Results are rounded towards zero.
Exceptions
Argument | value is null. |
Round(BigFloat, Int32, MidpointRounding)
Rounds a value to a specified number of fractional digits using the specified rounding mode.
public static BigFloat Round(
BigFloat value,
int digits,
MidpointRounding midpointRounding
)
Parameters
- value BigFloat
- digits Int32
- The number of fractional digits to which x should be rounded.
- midpointRounding MidpointRounding
Return Value
BigFloatThe result of rounding x to digits fractional-digits using mode.