BigRational.Round Method

Definition

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

Overload List

Round(BigRational) Rounds a rational number to the nearest integer.
Round(BigRational, Int32) Rounds a rational number to the specified number of decimal digits.

Round(BigRational)

Rounds a rational number to the nearest integer.
C#
public static BigRational Round(
	BigRational value
)

Parameters

value  BigRational
A rational number.

Return Value

BigRational
The integer rational number that is closest to value.

Round(BigRational, Int32)

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

Parameters

value  BigRational
A rational number.
decimals  Int32
The number of decimal digits.

Return Value

BigRational
A rational number 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.

See Also