BigFloat.Round Method

Definition

Namespace: Numerics.NET
Assembly: Numerics.NET (in Numerics.NET.dll) Version: 9.0.0

Overload List

Round(BigFloat) Rounds a BigFloat value to the nearest integer.
Round(BigFloat, Int32) Rounds a BigFloat value to the specified number of decimal digits.
Round(BigFloat, Int32, RoundingMode) Rounds a BigFloat value to the specified number of decimal digits.
Round(BigFloat, Int32, MidpointRounding)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.
C#
public static BigFloat Round(
	BigFloat value
)

Parameters

value  BigFloat
A BigFloat value.

Return Value

BigFloat
The BigFloat value that equals the integer closest to value.

Implements

IFloatingPoint<TSelf>.Round(TSelf)

Exceptions

ArgumentNullException

value is null.

Round(BigFloat, Int32)

Rounds a BigFloat value to the specified number of decimal digits.
C#
public static BigFloat Round(
	BigFloat value,
	int digits
)

Parameters

value  BigFloat
A BigFloat value.
digits  Int32
The number of decimal digits.

Return Value

BigFloat
The 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

ArgumentNullException

value is null.

Round(BigFloat, Int32, RoundingMode)

Rounds a BigFloat value to the specified number of decimal digits.
C#
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

BigFloat
The 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

ArgumentNullException

value is null.

Round(BigFloat, Int32, MidpointRounding)

Rounds a value to a specified number of fractional digits using the specified rounding mode.
C#
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

BigFloat
The result of rounding x to digits fractional-digits using mode.

Implements

IFloatingPoint<TSelf>.Round(TSelf, Int32, MidpointRounding)

See Also