BigFloat.FromRational Method

Constructs a new arbitrary precision floating-point number from a rational number.

Definition

Namespace: Numerics.NET
Assembly: Numerics.NET (in Numerics.NET.dll) Version: 10.10.0
C#
public static BigFloat FromRational(
	BigInteger numerator,
	BigInteger denominator,
	AccuracyGoal accuracyGoal,
	RoundingMode roundingMode
)

Parameters

numerator  BigInteger
The numerator of the rational number.
denominator  BigInteger
The denominator of the rational number.
accuracyGoal  AccuracyGoal
The desired AccuracyGoal for the floating-point number.
roundingMode  RoundingMode
A RoundingMode value that specifies how the result should be rounded.

Return Value

BigFloat

Remarks

The exact fraction is rounded once to the relative significand precision or absolute binary grid specified by accuracyGoal.

Exceptions

NotSupportedExceptionThe required integer shift or binary exponent extent cannot be represented.

See Also