Quad.Round Method

Definition

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

Overload List

Round(Quad) Rounds a Quad value to the nearest integral value.
Round(Quad, Int32) Rounds a Quad value to a specified number of fractional digits.
Round(Quad, MidpointRounding) Rounds a Quad value to the nearest integer. A parameter specifies how to round the value if it is midway between two other numbers.
Round(Quad, Int32, MidpointRounding) Rounds a Quad value to a specified number of fractional digits. A parameter specifies how to round the value if it is midway between two other numbers.

Round(Quad)

Rounds a Quad value to the nearest integral value.
C#
public static Quad Round(
	Quad value
)

Parameters

value  Quad
A quadruple precision number to be rounded.

Return Value

Quad
The integer nearest parameter value. If the fractional component of value is halfway between two integers, one of which is even and the other odd, the even number is returned. Note that this method returns a System.Decimal instead of an integral type.

Implements

IFloatingPoint<TSelf>.Round(TSelf)

Exceptions

OverflowException

The result is outside the range of a System.Decimal.

Round(Quad, Int32)

Rounds a Quad value to a specified number of fractional digits.
C#
public static Quad Round(
	Quad value,
	int decimals
)

Parameters

value  Quad
A quadruple precision number to be rounded.
decimals  Int32
The number of Quad places in the return value.

Return Value

Quad
The number nearest to value that contains a number of fractional digits equal to decimals.

Implements

IFloatingPoint<TSelf>.Round(TSelf, Int32)

Exceptions

ArgumentOutOfRangeException

decimals is less than 0 or greater than 28.

OverflowException

The result is outside the range of a System.Decimal.

Round(Quad, MidpointRounding)

Rounds a Quad value to the nearest integer. A parameter specifies how to round the value if it is midway between two other numbers.
C#
public static Quad Round(
	Quad value,
	MidpointRounding mode
)

Parameters

value  Quad
A quadruple precision number to be rounded.
mode  MidpointRounding
Specification for how to round value if it is midway between two other numbers.

Return Value

Quad
The integer nearest value. If value is halfway between two numbers, one of which is even and the other odd, then mode determines which of the two is returned.

Implements

IFloatingPoint<TSelf>.Round(TSelf, MidpointRounding)

Exceptions

ArgumentException

mode is not a valid value of System.MidpointRounding.

OverflowException

The result is outside the range of a System.Decimal.

Round(Quad, Int32, MidpointRounding)

Rounds a Quad value to a specified number of fractional digits. A parameter specifies how to round the value if it is midway between two other numbers.
C#
public static Quad Round(
	Quad value,
	int decimals,
	MidpointRounding mode
)

Parameters

value  Quad
A quadruple precision number to be rounded.
decimals  Int32
The number of Quad places in the return value.
mode  MidpointRounding
Specification for how to round value if it is midway between two other numbers.

Return Value

Quad
The number nearest to value that contains a number of fractional digits equal to decimals. If the number of fractional digits in value is less than decimals, value is returned unchanged.

Implements

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

Exceptions

ArgumentOutOfRangeException

decimals is less than 0 or greater than 28.

ArgumentException

mode is not a valid value of System.MidpointRounding.

OverflowException

The result is outside the range of a System.Decimal.

See Also