Accord.NET Framework

## Rational Methods |

The Rational type exposes the following members.

Methods

Name | Description | |
---|---|---|

Abs |
Returns the absolute value of a Rational.
| |

CompareTo(Object) |
Compares this instance to another Rational and returns an indication of their relative values.
| |

CompareTo(Rational) |
Compares this instance to another Rational and returns an indication of their relative values.
| |

DivRem |
Calculates the quotient of two rational numbers and also returns the remainder in an output parameter.
| |

Equals(Object) |
Indicates whether this instance and a specified object are equal.
(Overrides ValueTypeEquals(Object).) | |

Equals(Rational) |
Indicates whether this instance and a specified Rational are equal.
| |

FromDecimal |
Converts a floating-point number to a rational number.
| |

FromDouble |
Converts a floating-point number to a rational number.
| |

FromDoubleWithMaxDenominator |
Converts a floating-point decimal to a rational number.
| |

GetHashCode |
Returns the hash code for this instance.
(Overrides ValueTypeGetHashCode.) | |

GetType | Gets the Type of the current instance. (Inherited from Object.) | |

Inverse |
Gets the inverse of the current Rational value (that is, one divided by the current value).
| |

IsIndeterminate |
Returns a value that indicates whether the specified Rational represents an indeterminate value.
| |

IsInfinity |
Returns a value that indicates whether the specified Rational evaluates to positive or negative infinity.
| |

IsNegativeInfinity |
Returns a value that indicates whether the specified Rational evaluates to negative infinity.
| |

IsPositiveInfinity |
Returns a value that indicates whether the specified Rational evaluates to positive infinity.
| |

IsZero |
Returns a value that indicates whether the specified Rational evaluates to zero.
| |

Max |
Returns the larger of two Rationals.
| |

Min |
Returns the smaller of two Rationals.
| |

Negate |
Gets the negated version of the current Rational value (that is, the current value multiplied by negative one).
| |

Parse(String) |
Converts the string representation of a number to its Rational representation.
| |

Parse(String, NumberStyles) |
Converts the string representation of a number to its Rational representation.
| |

Parse(String, IFormatProvider) |
Converts the string representation of a number to its Rational representation.
| |

Parse(String, NumberStyles, IFormatProvider) |
Converts the string representation of a number to its Rational representation.
| |

Pow |
Returns a specified number raised to a specified power.
| |

Round |
Rounds a Rational to the nearest integral value.
| |

Simplify |
Gets the simplified version of the rational number.
| |

Simplify(Int32, Int32) |
Gets the simplified version of the rational number.
| |

Simplify(Int64, Int64) |
Gets the simplified version of the rational number.
| |

StrictlyEquals |
Indicates whether this instance and a specified Rational are strictly equal; that is, the two instances must have equal numerators and denominators.
| |

ToDouble |
Converts the current Rational to a double.
| |

ToMixedString |
Converts the Rational to a string in the form of a mixed fraction.
| |

ToMixedString(String) |
Converts the Rational to a string in the form of a mixed fraction.
| |

ToString |
Converts the Rational to a string in the form of an improper fraction.
(Overrides ValueTypeToString.) | |

ToString(IFormatProvider) |
Converts this instance to its equivalent string representation.
| |

ToString(String, IFormatProvider) |
Converts this instance to its equivalent string representation.
| |

TryParse(String, Rational) |
Converts the string representation of a number to its Rational representation. A return value indicates whether the conversion succeeded or failed.
| |

TryParse(String, NumberStyles, Rational) |
Converts the string representation of a number to its Rational representation. A return value indicates whether the conversion succeeded or failed.
| |

TryParse(String, IFormatProvider, Rational) |
Converts the string representation of a number to its Rational representation. A return value indicates whether the conversion succeeded or failed.
| |

TryParse(String, NumberStyles, IFormatProvider, Rational) |

Extension Methods

Name | Description | |
---|---|---|

HasMethod |
Checks whether an object implements a method with the given name.
(Defined by ExtensionMethods.) | |

IsEqual |
Compares two objects for equality, performing an elementwise
comparison if the elements are vectors or matrices.
(Defined by Matrix.) | |

To(Type) | Overloaded.
Converts an object into another type, irrespective of whether
the conversion can be done at compile time or not. This can be
used to convert generic types to numeric types during runtime.
(Defined by ExtensionMethods.) | |

ToT | Overloaded.
Converts an object into another type, irrespective of whether
the conversion can be done at compile time or not. This can be
used to convert generic types to numeric types during runtime.
(Defined by ExtensionMethods.) |

See Also