Click or drag to resize
Accord.NET (logo)

RationalFromDecimal Method

Converts a floating-point number to a rational number.

Namespace:  Accord.Math
Assembly:  Accord (in Accord.dll) Version: 3.8.0
Syntax
public static Rational FromDecimal(
	decimal value,
	[OptionalAttribute] decimal tolerance
)
Request Example View Source

Parameters

value
Type: SystemDecimal
A floating-point number to convert to a rational number.
tolerance (Optional)
Type: SystemDecimal
The maximum error allowed between the result and the input value.

Return Value

Type: Rational
A rational number.
See Also