# Struct rug::Rational [−] [src]

`pub struct Rational { /* fields omitted */ }`

An arbitrary-precision rational number.

A rational number is made up of a numerator `Integer` and denominator `Integer`. After rational number functions, the number is always in canonical form, that is, the denominator is always greater than zero, and there are no common factors. Zero is stored as 0/1.

# Examples

```use rug::Rational;
let r = Rational::from((-12, 15));
let recip = Rational::from(r.recip_ref());
assert_eq!(recip, (-5, 4));
assert_eq!(recip.to_f32(), -1.25);
// The numerator and denominator are stored in canonical form.
let (num, den) = r.into_numer_denom();
assert_eq!(num, -4);
assert_eq!(den, 5);```

## Methods

### `impl Rational`[src]

#### `fn new() -> Rational`

Constructs a new arbitrary-precision rational number with value 0.

# Examples

```use rug::Rational;
let r = Rational::new();
assert_eq!(r, 0);```

#### `fn from_f32(val: f32) -> Option<Rational>`

Creates a `Rational` from an `f32` if it is finite, losing no precision.

# Examples

```use rug::Rational;
use std::f32;
let r = Rational::from_f32(-17125e-3).unwrap();
assert_eq!(r, "-17125/1000".parse::<Rational>().unwrap());
let inf = Rational::from_f32(f32::INFINITY);
assert!(inf.is_none());```

#### `fn from_f64(val: f64) -> Option<Rational>`

Creates a `Rational` from an `f64` if it is finite, losing no precision.

# Examples

```use rug::Rational;
use std::f64;
let r = Rational::from_f64(-17125e-3).unwrap();
assert_eq!(r, "-17125/1000".parse::<Rational>().unwrap());
let inf = Rational::from_f64(f64::INFINITY);
assert!(inf.is_none());```

#### `fn from_str_radix(src: &str, radix: i32) -> Result<Rational, ParseRationalError>`

Parses a `Rational` number.

# Examples

```use rug::Rational;
let r1 = Rational::from_str_radix("ff/a", 16).unwrap();
assert_eq!(r1, (255, 10));
let r2 = Rational::from_str_radix("+ff0/a0", 16).unwrap();
assert_eq!(r2, (0xff0, 0xa0));
assert_eq!(*r2.numer(), 51);
assert_eq!(*r2.denom(), 2);```

# Panics

Panics if `radix` is less than 2 or greater than 36.

#### `fn valid_str_radix(    src: &str,     radix: i32) -> Result<ValidRational, ParseRationalError>`

Checks if a `Rational` number can be parsed.

If this method does not return an error, neither will any other function that parses a `Rational` number. If this method returns an error, the other functions will return the same error.

The string must contain a numerator, and may contain a denominator; the numberator and denominator are separated with a `'/'`. The numerator can start with an optional minus or plus sign.

Whitespace is not allowed anywhere in the string, including in the beginning and end and around the `'/'`.

# Examples

```use rug::Rational;

let valid1 = Rational::valid_str_radix("12/23", 4);
let r1 = Rational::from(valid1.unwrap());
assert_eq!(r1, (2 + 4 * 1, 3 + 4 * 2));
let valid2 = Rational::valid_str_radix("12/yz", 36);
let r2 = Rational::from(valid2.unwrap());
assert_eq!(r2, (2 + 36 * 1, 35 + 36 * 34));

let invalid = Rational::valid_str_radix("12 / 23", 4);
let invalid_f = Rational::from_str_radix("12 / 23", 4);
assert_eq!(invalid.unwrap_err(), invalid_f.unwrap_err());```

# Panics

Panics if `radix` is less than 2 or greater than 36.

#### `fn to_integer(&self) -> Integer`

Converts to an `Integer`, rounding towards zero.

# Examples

```use rug::Rational;
let pos = Rational::from((139, 10));
let posi = pos.to_integer();
assert_eq!(posi, 13);
let neg = Rational::from((-139, 10));
let negi = neg.to_integer();
assert_eq!(negi, -13);```

#### `fn copy_to_integer(&self, i: &mut Integer)`

Converts to an `Integer` inside `i`, rounding towards zero.

# Examples

```use rug::{Integer, Rational};
let mut i = Integer::new();
assert_eq!(i, 0);
let pos = Rational::from((139, 10));
pos.copy_to_integer(&mut i);
assert_eq!(i, 13);
let neg = Rational::from((-139, 10));
neg.copy_to_integer(&mut i);
assert_eq!(i, -13);```

#### `fn to_f32(&self) -> f32`

Converts to an `f32`, rounding towards zero.

# Examples

```use rug::Rational;
use rug::rational::SmallRational;
use std::f32;
let min = Rational::from_f32(f32::MIN).unwrap();
let minus_small = min - &*SmallRational::from((7, 2));
// minus_small is truncated to f32::MIN
assert_eq!(minus_small.to_f32(), f32::MIN);
let times_three_two = minus_small * &*SmallRational::from((3, 2));
// times_three_two is too small
assert_eq!(times_three_two.to_f32(), f32::NEG_INFINITY);```

#### `fn to_f64(&self) -> f64`

Converts to an `f64`, rounding towards zero.

# Examples

```use rug::Rational;
use rug::rational::SmallRational;
use std::f64;

// An `f64` has 53 bits of precision.
let exact = 0x1f_1234_5678_9aff_u64;
let den = 0x1000_u64;
let r = Rational::from((exact, den));
assert_eq!(r.to_f64(), exact as f64 / den as f64);

// large has 56 ones
let large = 0xff_1234_5678_9aff_u64;
// trunc has 53 ones followed by 3 zeros
let trunc = 0xff_1234_5678_9af8_u64;
let j = Rational::from((large, den));
assert_eq!(j.to_f64(), trunc as f64 / den as f64);

let max = Rational::from_f64(f64::MAX).unwrap();
let plus_small = max + &*SmallRational::from((7, 2));
// plus_small is truncated to f64::MAX
assert_eq!(plus_small.to_f64(), f64::MAX);
let times_three_two = plus_small * &*SmallRational::from((3, 2));
// times_three_two is too large
assert_eq!(times_three_two.to_f64(), f64::INFINITY);```

#### `fn to_string_radix(&self, radix: i32) -> String`

Returns a string representation for the specified `radix`.

# Examples

```use rug::Rational;
let r1 = Rational::from(0);
assert_eq!(r1.to_string_radix(10), "0");
let r2 = Rational::from((15, 5));
assert_eq!(r2.to_string_radix(10), "3");
let r3 = Rational::from((10, -6));
assert_eq!(r3.to_string_radix(10), "-5/3");
assert_eq!(r3.to_string_radix(5), "-10/3");```

# Panics

Panics if `radix` is less than 2 or greater than 36.

#### `fn assign_f32(&mut self, val: f32) -> Result<(), ()>`

Assigns from an `f32` if it is finite, losing no precision.

# Examples

```use rug::Rational;
use std::f32;
let mut r = Rational::new();
let ret = r.assign_f32(12.75);
assert!(ret.is_ok());
assert_eq!(r, (1275, 100));
let ret = r.assign_f32(f32::NAN);
assert!(ret.is_err());
assert_eq!(r, (1275, 100));```

#### `fn assign_f64(&mut self, val: f64) -> Result<(), ()>`

Assigns from an `f64` if it is finite, losing no precision.

# Examples

```use rug::Rational;
let mut r = Rational::new();
let ret = r.assign_f64(12.75);
assert!(ret.is_ok());
assert_eq!(r, (1275, 100));
let ret = r.assign_f64(1.0 / 0.0);
assert!(ret.is_err());
assert_eq!(r, (1275, 100));```

#### `fn assign_str(&mut self, src: &str) -> Result<(), ParseRationalError>`

Parses a `Rational` number from a string.

# Examples

```use rug::Rational;
let mut r = Rational::new();
let ret = r.assign_str("1/0");
assert!(ret.is_err());
r.assign_str("-24/2").unwrap();
assert_eq!(*r.numer(), -12);
assert_eq!(*r.denom(), 1);```

#### `fn assign_str_radix(    &mut self,     src: &str,     radix: i32) -> Result<(), ParseRationalError>`

Parses a `Rational` number from a string with the specified radix.

# Examples

```use rug::Rational;
let mut r = Rational::new();
r.assign_str_radix("ff/a", 16).unwrap();
assert_eq!(r, (255, 10));
r.assign_str_radix("+ff0/a0", 16).unwrap();
assert_eq!(r, (255, 10));```

# Panics

Panics if `radix` is less than 2 or greater than 36.

#### `fn numer(&self) -> &Integer`

Borrows the numerator as an `Integer`.

# Examples

```use rug::Rational;
let r = Rational::from((12, -20));
// r will be canonicalized to -3 / 5
assert_eq!(*r.numer(), -3)```

#### `fn denom(&self) -> &Integer`

Borrows the denominator as an `Integer`.

# Examples

```use rug::Rational;
let r = Rational::from((12, -20));
// r will be canonicalized to -3 / 5
assert_eq!(*r.denom(), 5);```

#### `fn as_numer_denom(&self) -> (&Integer, &Integer)`

Borrows the numerator and denominator as `Integer`s.

# Examples

```use rug::Rational;
let r = Rational::from((12, -20));
// r will be canonicalized to -3 / 5
let (num, den) = r.as_numer_denom();
assert_eq!(*num, -3);
assert_eq!(*den, 5);```

#### `fn as_mut_numer_denom(&mut self) -> MutNumerDenom`

Borrows the numerator and denominator mutably. The number is canonicalized when the borrow ends. The denominator must not be zero when the borrow ends.

# Examples

```use rug::Rational;

let mut r = Rational::from((3, 5));
{
let mut num_den = r.as_mut_numer_denom();
// change r from 3/5 to 4/8, which is equal to 1/2
*num_den.num() += 1;
*num_den.den() += 3;
// borrow ends here
}
let num_den = r.as_numer_denom();
assert_eq!(*num_den.0, 1);
assert_eq!(*num_den.1, 2);```

If the mutable value is leaked, the denominator is lost when the borrow ends.

```use rug::Rational;
use std::mem;

let mut r = Rational::from((3, 5));
{
let mut num_den = r.as_mut_numer_denom();
// try change r from 3/5 to 4/8
*num_den.num() += 1;
*num_den.den() += 3;
// forget num_den, so no canonicalization takes place
mem::forget(num_den)
// borrow ends here, but nothing happens
}
// because of the leak, 4/8 has become 4/1
let num_den = r.as_numer_denom();
assert_eq!(*num_den.0, 4);
assert_eq!(*num_den.1, 1);```

# Panics

Panics if the denominator is zero when the borrow ends.

#### `unsafe fn as_mut_numer_denom_no_canonicalization(    &mut self) -> (&mut Integer, &mut Integer)`

Borrows the numerator and denominator mutably without canonicalizing aftwerwards.

# Safety

This function is unsafe because it does not canonicalize the rational number when the borrow ends. The rest of the library assumes that `Rational` structures keep their numerators and denominators canonicalized.

# Examples

```use rug::Rational;

let mut r = Rational::from((3, 5));
{
let (num, den) = unsafe {
r.as_mut_numer_denom_no_canonicalization()
};
// Add one to r by adding den to num. Since num and den
// are relatively prime, r remains canonicalized.
*num += &*den;
}
assert_eq!(r, (8, 5));```

#### `fn into_numer_denom(self) -> (Integer, Integer)`

Converts into numerator and denominator integers.

This function reuses the allocated memory and does not allocate any new memory.

# Examples

```use rug::Rational;
let r = Rational::from((12, -20));
// r will be canonicalized to -3 / 5
let (num, den) = r.into_numer_denom();
assert_eq!(num, -3);
assert_eq!(den, 5);```

#### `fn sign(&self) -> Ordering`

Returns `Less` if the number is less than zero, `Greater` if it is greater than zero, or `Equal` if it is equal to zero.

#### `fn abs(&mut self) -> &mut Rational`

Computes the absolute value.

# Examples

```use rug::Rational;
let mut r = Rational::from((-100, 17));
assert_eq!(*r.abs(), (100, 17));
assert_eq!(r, (100, 17));```

#### `fn abs_ref(&self) -> AbsRef`

Computes the absolute value.

# Examples

```use rug::Rational;
let r = Rational::from((-100, 17));
let rr = r.abs_ref();
let abs = Rational::from(rr);
assert_eq!(abs, (100, 17));```

#### `fn recip(&mut self) -> &mut Rational`

Computes the reciprocal.

# Examples

```use rug::Rational;
let mut r = Rational::from((-100, 17));
assert_eq!(*r.recip(), (-17, 100));
assert_eq!(r, (-17, 100));```

# Panics

Panics if the value is zero.

#### `fn recip_ref(&self) -> RecipRef`

Computes the reciprocal.

# Examples

```use rug::Rational;
let r = Rational::from((-100, 17));
let rr = r.recip_ref();
let recip = Rational::from(rr);
assert_eq!(recip, (-17, 100));```

#### `fn ceil_ref(&self) -> CeilRef`

Rounds the number upwards (towards plus infinity).

# Examples

```use rug::{Assign, Integer};
use rug::rational::SmallRational;
let mut ceil = Integer::new();
ceil.assign(SmallRational::from(-1).ceil_ref());
assert_eq!(ceil, -1);
ceil.assign(SmallRational::from((-1, 2)).ceil_ref());
assert_eq!(ceil, 0);
ceil.assign(SmallRational::from(0).ceil_ref());
assert_eq!(ceil, 0);
ceil.assign(SmallRational::from((1, 2)).ceil_ref());
assert_eq!(ceil, 1);
ceil.assign(SmallRational::from(1).ceil_ref());
assert_eq!(ceil, 1);```

#### `fn floor_ref(&self) -> FloorRef`

Rounds the number downwards (towards minus infinity).

# Examples

```use rug::{Assign, Integer};
use rug::rational::SmallRational;
let mut floor = Integer::new();
floor.assign(SmallRational::from(-1).floor_ref());
assert_eq!(floor, -1);
floor.assign(SmallRational::from((-1, 2)).floor_ref());
assert_eq!(floor, -1);
floor.assign(SmallRational::from(0).floor_ref());
assert_eq!(floor, 0);
floor.assign(SmallRational::from((1, 2)).floor_ref());
assert_eq!(floor, 0);
floor.assign(SmallRational::from(1).floor_ref());
assert_eq!(floor, 1);```

#### `fn round_ref(&self) -> RoundRef`

Rounds the number to the nearest integer. When the number lies exactly between two integers, it is rounded away from zero.

# Examples

```use rug::{Assign, Integer};
use rug::rational::SmallRational;
let mut round = Integer::new();
round.assign(SmallRational::from((-17, 10)).round_ref());
assert_eq!(round, -2);
round.assign(SmallRational::from((-15, 10)).round_ref());
assert_eq!(round, -2);
round.assign(SmallRational::from((-13, 10)).round_ref());
assert_eq!(round, -1);
round.assign(SmallRational::from((13, 10)).round_ref());
assert_eq!(round, 1);
round.assign(SmallRational::from((15, 10)).round_ref());
assert_eq!(round, 2);
round.assign(SmallRational::from((17, 10)).round_ref());
assert_eq!(round, 2);```

#### `fn trunc_ref(&self) -> TruncRef`

Rounds the number towards zero.

# Examples

```use rug::{Assign, Integer};
use rug::rational::SmallRational;
let mut trunc = Integer::new();
trunc.assign(SmallRational::from((-21, 10)).trunc_ref());
assert_eq!(trunc, -2);
trunc.assign(SmallRational::from((-17, 10)).trunc_ref());
assert_eq!(trunc, -1);
trunc.assign(SmallRational::from((13, 10)).trunc_ref());
assert_eq!(trunc, 1);
trunc.assign(SmallRational::from((19, 10)).trunc_ref());
assert_eq!(trunc, 1);```

#### `fn fract(&mut self) -> &mut Rational`

Computes the fractional part of the number.

# Examples

```use rug::Rational;
// -100/17 = -5 15/17
let mut r = Rational::from((-100, 17));
assert_eq!(*r.fract(), (-15, 17));```

#### `fn fract_ref(&self) -> FractRef`

Computes the fractional part of the number.

# Examples

```use rug::Rational;
let r = Rational::from((-100, 17));
let rr = r.fract_ref();
let fract = Rational::from(rr);
assert_eq!(fract, (-15, 17));```

#### `fn fract_trunc(&mut self, trunc: &mut Integer)`

Computes the fractional and truncated parts of the number.

# Examples

```use rug::{Integer, Rational};
// -100/17 = -5 15/17
let mut r = Rational::from((-100, 17));
let mut whole = Integer::new();
r.fract_trunc(&mut whole);
assert_eq!(whole, -5);
assert_eq!(r, (-15, 17));```

#### `fn fract_trunc_ref(&self) -> FractTruncRef`

Computes the fractional and truncated parts of the number.

# Examples

```use rug::{Assign, Integer, Rational};
// -100/17 = -5 15/17
let r = Rational::from((-100, 17));
let rr = r.fract_trunc_ref();
let (mut proper, mut whole) = (Rational::new(), Integer::new());
(&mut proper, &mut whole).assign(rr);
assert_eq!(whole, -5);
assert_eq!(proper, (-15, 17));```

## Trait Implementations

### `impl Default for Rational`[src]

#### `fn default() -> Rational`

Returns the "default value" for a type. Read more

### `impl Clone for Rational`[src]

#### `fn clone(&self) -> Rational`

Returns a copy of the value. Read more

#### `fn clone_from(&mut self, source: &Rational)`

Performs copy-assignment from `source`. Read more

### `impl Drop for Rational`[src]

#### `fn drop(&mut self)`

A method called when the value goes out of scope. Read more

### `impl<'a> From<&'a Rational> for Rational`[src]

#### `fn from(t: &'a Rational) -> Rational`

Performs the conversion.

### `impl From<Integer> for Rational`[src]

#### `fn from(val: Integer) -> Rational`

Constructs a `Rational` number from an `Integer`.

This constructor allocates one new `Integer` and reuses the allocation for `val`.

### `impl<'a> From<&'a Integer> for Rational`[src]

#### `fn from(t: &'a Integer) -> Rational`

Performs the conversion.

### `impl From<(Integer, Integer)> for Rational`[src]

#### `fn from((num, den): (Integer, Integer)) -> Rational`

Constructs a `Rational` number from a numerator `Integer` and denominator `Integer`.

This constructor does not allocate, as it reuses the `Integer` components.

# Panics

Panics if the denominator is zero.

### `impl<'a> From<(&'a Integer, &'a Integer)> for Rational`[src]

#### `fn from(t: (&'a Integer, &'a Integer)) -> Rational`

Performs the conversion.

### `impl From<i32> for Rational`[src]

#### `fn from(t: i32) -> Rational`

Performs the conversion.

### `impl From<i64> for Rational`[src]

#### `fn from(t: i64) -> Rational`

Performs the conversion.

### `impl From<u32> for Rational`[src]

#### `fn from(t: u32) -> Rational`

Performs the conversion.

### `impl From<u64> for Rational`[src]

#### `fn from(t: u64) -> Rational`

Performs the conversion.

### `impl From<(i32, i32)> for Rational`[src]

#### `fn from(t: (i32, i32)) -> Rational`

Performs the conversion.

### `impl From<(i64, i64)> for Rational`[src]

#### `fn from(t: (i64, i64)) -> Rational`

Performs the conversion.

### `impl From<(i32, u32)> for Rational`[src]

#### `fn from(t: (i32, u32)) -> Rational`

Performs the conversion.

### `impl From<(i64, u64)> for Rational`[src]

#### `fn from(t: (i64, u64)) -> Rational`

Performs the conversion.

### `impl From<(u32, i32)> for Rational`[src]

#### `fn from(t: (u32, i32)) -> Rational`

Performs the conversion.

### `impl From<(u64, i64)> for Rational`[src]

#### `fn from(t: (u64, i64)) -> Rational`

Performs the conversion.

### `impl From<(u32, u32)> for Rational`[src]

#### `fn from(t: (u32, u32)) -> Rational`

Performs the conversion.

### `impl From<(u64, u64)> for Rational`[src]

#### `fn from(t: (u64, u64)) -> Rational`

Performs the conversion.

### `impl FromStr for Rational`[src]

#### `type Err = ParseRationalError`

The associated error which can be returned from parsing.

#### `fn from_str(src: &str) -> Result<Rational, ParseRationalError>`

Parses a string `s` to return a value of this type. Read more

### `impl Display for Rational`[src]

#### `fn fmt(&self, f: &mut Formatter) -> Result`

Formats the value using the given formatter. Read more

### `impl Debug for Rational`[src]

#### `fn fmt(&self, f: &mut Formatter) -> Result`

Formats the value using the given formatter.

### `impl Binary for Rational`[src]

#### `fn fmt(&self, f: &mut Formatter) -> Result`

Formats the value using the given formatter.

### `impl Octal for Rational`[src]

#### `fn fmt(&self, f: &mut Formatter) -> Result`

Formats the value using the given formatter.

### `impl LowerHex for Rational`[src]

#### `fn fmt(&self, f: &mut Formatter) -> Result`

Formats the value using the given formatter.

### `impl UpperHex for Rational`[src]

#### `fn fmt(&self, f: &mut Formatter) -> Result`

Formats the value using the given formatter.

### `impl Assign for Rational`[src]

#### `fn assign(&mut self, other: Rational)`

Peforms the assignement. Read more

### `impl<'a> Assign<&'a Rational> for Rational`[src]

#### `fn assign(&mut self, other: &'a Rational)`

Peforms the assignement. Read more

### `impl<'a> Assign<&'a Integer> for Rational`[src]

#### `fn assign(&mut self, val: &'a Integer)`

Peforms the assignement. Read more

### `impl Assign<Integer> for Rational`[src]

#### `fn assign(&mut self, t: Integer)`

Peforms the assignement. Read more

### `impl Assign<i32> for Rational`[src]

#### `fn assign(&mut self, t: i32)`

Peforms the assignement. Read more

### `impl Assign<i64> for Rational`[src]

#### `fn assign(&mut self, t: i64)`

Peforms the assignement. Read more

### `impl Assign<u32> for Rational`[src]

#### `fn assign(&mut self, t: u32)`

Peforms the assignement. Read more

### `impl Assign<u64> for Rational`[src]

#### `fn assign(&mut self, t: u64)`

Peforms the assignement. Read more

### `impl<T, U> Assign<(T, U)> for Rational where    Integer: Assign<T>,    Integer: Assign<U>, `[src]

#### `fn assign(&mut self, (num, den): (T, U))`

Peforms the assignement. Read more

### `impl<'a> From<AbsRef<'a>> for Rational`[src]

#### `fn from(t: AbsRef<'a>) -> Rational`

Performs the conversion.

### `impl<'a> Assign<AbsRef<'a>> for Rational`[src]

#### `fn assign(&mut self, src: AbsRef<'a>)`

Peforms the assignement. Read more

### `impl<'a> From<RecipRef<'a>> for Rational`[src]

#### `fn from(t: RecipRef<'a>) -> Rational`

Performs the conversion.

### `impl<'a> Assign<RecipRef<'a>> for Rational`[src]

#### `fn assign(&mut self, src: RecipRef<'a>)`

Peforms the assignement. Read more

### `impl<'a> From<FractRef<'a>> for Rational`[src]

#### `fn from(t: FractRef<'a>) -> Rational`

Performs the conversion.

### `impl<'a> Assign<FractRef<'a>> for Rational`[src]

#### `fn assign(&mut self, src: FractRef<'a>)`

Peforms the assignement. Read more

### `impl Neg for Rational`[src]

#### `type Output = Rational`

The resulting type after applying the `-` operator

#### `fn neg(self) -> Rational`

The method for the unary `-` operator

### `impl NegAssign for Rational`[src]

#### `fn neg_assign(&mut self)`

Peforms the negation. Read more

### `impl<'a> Neg for &'a Rational`[src]

#### `type Output = NegRef<'a>`

The resulting type after applying the `-` operator

#### `fn neg(self) -> NegRef<'a>`

The method for the unary `-` operator

### `impl<'a> From<NegRef<'a>> for Rational`[src]

#### `fn from(t: NegRef<'a>) -> Rational`

Performs the conversion.

### `impl<'a> Assign<NegRef<'a>> for Rational`[src]

#### `fn assign(&mut self, rhs: NegRef)`

Peforms the assignement. Read more

### `impl Add<Rational> for Rational`[src]

#### `type Output = Rational`

The resulting type after applying the `+` operator

#### `fn add(self, op: Rational) -> Rational`

The method for the `+` operator

### `impl<'a> Add<&'a Rational> for Rational`[src]

#### `type Output = Rational`

The resulting type after applying the `+` operator

#### `fn add(self, op: &'a Rational) -> Rational`

The method for the `+` operator

### `impl AddAssign<Rational> for Rational`[src]

#### `fn add_assign(&mut self, op: Rational)`

The method for the `+=` operator

### `impl<'a> AddAssign<&'a Rational> for Rational`[src]

#### `fn add_assign(&mut self, op: &'a Rational)`

The method for the `+=` operator

### `impl<'a> Add<&'a Rational> for &'a Rational`[src]

#### `type Output = AddRef<'a>`

The resulting type after applying the `+` operator

#### `fn add(self, rhs: &'a Rational) -> AddRef<'a>`

The method for the `+` operator

### `impl<'a> From<AddRef<'a>> for Rational`[src]

#### `fn from(t: AddRef<'a>) -> Rational`

Performs the conversion.

### `impl<'a> Assign<AddRef<'a>> for Rational`[src]

#### `fn assign(&mut self, rhs: AddRef)`

Peforms the assignement. Read more

### `impl Sub<Rational> for Rational`[src]

#### `type Output = Rational`

The resulting type after applying the `-` operator

#### `fn sub(self, op: Rational) -> Rational`

The method for the `-` operator

### `impl<'a> Sub<&'a Rational> for Rational`[src]

#### `type Output = Rational`

The resulting type after applying the `-` operator

#### `fn sub(self, op: &'a Rational) -> Rational`

The method for the `-` operator

### `impl SubAssign<Rational> for Rational`[src]

#### `fn sub_assign(&mut self, op: Rational)`

The method for the `-=` operator

### `impl<'a> SubAssign<&'a Rational> for Rational`[src]

#### `fn sub_assign(&mut self, op: &'a Rational)`

The method for the `-=` operator

### `impl<'a> Sub<&'a Rational> for &'a Rational`[src]

#### `type Output = SubRef<'a>`

The resulting type after applying the `-` operator

#### `fn sub(self, rhs: &'a Rational) -> SubRef<'a>`

The method for the `-` operator

### `impl<'a> From<SubRef<'a>> for Rational`[src]

#### `fn from(t: SubRef<'a>) -> Rational`

Performs the conversion.

### `impl<'a> Assign<SubRef<'a>> for Rational`[src]

#### `fn assign(&mut self, rhs: SubRef)`

Peforms the assignement. Read more

### `impl SubFromAssign<Rational> for Rational`[src]

#### `fn sub_from_assign(&mut self, lhs: Rational)`

Peforms the subtraction. Read more

### `impl<'a> SubFromAssign<&'a Rational> for Rational`[src]

#### `fn sub_from_assign(&mut self, lhs: &'a Rational)`

Peforms the subtraction. Read more

### `impl Mul<Rational> for Rational`[src]

#### `type Output = Rational`

The resulting type after applying the `*` operator

#### `fn mul(self, op: Rational) -> Rational`

The method for the `*` operator

### `impl<'a> Mul<&'a Rational> for Rational`[src]

#### `type Output = Rational`

The resulting type after applying the `*` operator

#### `fn mul(self, op: &'a Rational) -> Rational`

The method for the `*` operator

### `impl MulAssign<Rational> for Rational`[src]

#### `fn mul_assign(&mut self, op: Rational)`

The method for the `*=` operator

### `impl<'a> MulAssign<&'a Rational> for Rational`[src]

#### `fn mul_assign(&mut self, op: &'a Rational)`

The method for the `*=` operator

### `impl<'a> Mul<&'a Rational> for &'a Rational`[src]

#### `type Output = MulRef<'a>`

The resulting type after applying the `*` operator

#### `fn mul(self, rhs: &'a Rational) -> MulRef<'a>`

The method for the `*` operator

### `impl<'a> From<MulRef<'a>> for Rational`[src]

#### `fn from(t: MulRef<'a>) -> Rational`

Performs the conversion.

### `impl<'a> Assign<MulRef<'a>> for Rational`[src]

#### `fn assign(&mut self, rhs: MulRef)`

Peforms the assignement. Read more

### `impl Div<Rational> for Rational`[src]

#### `type Output = Rational`

The resulting type after applying the `/` operator

#### `fn div(self, op: Rational) -> Rational`

The method for the `/` operator

### `impl<'a> Div<&'a Rational> for Rational`[src]

#### `type Output = Rational`

The resulting type after applying the `/` operator

#### `fn div(self, op: &'a Rational) -> Rational`

The method for the `/` operator

### `impl DivAssign<Rational> for Rational`[src]

#### `fn div_assign(&mut self, op: Rational)`

The method for the `/=` operator

### `impl<'a> DivAssign<&'a Rational> for Rational`[src]

#### `fn div_assign(&mut self, op: &'a Rational)`

The method for the `/=` operator

### `impl<'a> Div<&'a Rational> for &'a Rational`[src]

#### `type Output = DivRef<'a>`

The resulting type after applying the `/` operator

#### `fn div(self, rhs: &'a Rational) -> DivRef<'a>`

The method for the `/` operator

### `impl<'a> From<DivRef<'a>> for Rational`[src]

#### `fn from(t: DivRef<'a>) -> Rational`

Performs the conversion.

### `impl<'a> Assign<DivRef<'a>> for Rational`[src]

#### `fn assign(&mut self, rhs: DivRef)`

Peforms the assignement. Read more

### `impl DivFromAssign<Rational> for Rational`[src]

#### `fn div_from_assign(&mut self, lhs: Rational)`

Peforms the division. Read more

### `impl<'a> DivFromAssign<&'a Rational> for Rational`[src]

#### `fn div_from_assign(&mut self, lhs: &'a Rational)`

Peforms the division. Read more

### `impl Shl<i32> for Rational`[src]

#### `type Output = Rational`

The resulting type after applying the `<<` operator

#### `fn shl(self, op: i32) -> Rational`

The method for the `<<` operator

### `impl ShlAssign<i32> for Rational`[src]

#### `fn shl_assign(&mut self, op: i32)`

The method for the `<<=` operator

### `impl<'a> Shl<i32> for &'a Rational`[src]

#### `type Output = ShlRefI32<'a>`

The resulting type after applying the `<<` operator

#### `fn shl(self, op: i32) -> ShlRefI32<'a>`

The method for the `<<` operator

### `impl<'a> From<ShlRefI32<'a>> for Rational`[src]

#### `fn from(t: ShlRefI32<'a>) -> Rational`

Performs the conversion.

### `impl<'a> Assign<ShlRefI32<'a>> for Rational`[src]

#### `fn assign(&mut self, rhs: ShlRefI32)`

Peforms the assignement. Read more

### `impl Shr<i32> for Rational`[src]

#### `type Output = Rational`

The resulting type after applying the `>>` operator

#### `fn shr(self, op: i32) -> Rational`

The method for the `>>` operator

### `impl ShrAssign<i32> for Rational`[src]

#### `fn shr_assign(&mut self, op: i32)`

The method for the `>>=` operator

### `impl<'a> Shr<i32> for &'a Rational`[src]

#### `type Output = ShrRefI32<'a>`

The resulting type after applying the `>>` operator

#### `fn shr(self, op: i32) -> ShrRefI32<'a>`

The method for the `>>` operator

### `impl<'a> From<ShrRefI32<'a>> for Rational`[src]

#### `fn from(t: ShrRefI32<'a>) -> Rational`

Performs the conversion.

### `impl<'a> Assign<ShrRefI32<'a>> for Rational`[src]

#### `fn assign(&mut self, rhs: ShrRefI32)`

Peforms the assignement. Read more

### `impl Pow<i32> for Rational`[src]

#### `type Output = Rational`

The resulting type after the power operation.

#### `fn pow(self, op: i32) -> Rational`

Performs the power operation. Read more

### `impl PowAssign<i32> for Rational`[src]

#### `fn pow_assign(&mut self, op: i32)`

Peforms the power operation. Read more

### `impl<'a> Pow<i32> for &'a Rational`[src]

#### `type Output = PowRefI32<'a>`

The resulting type after the power operation.

#### `fn pow(self, op: i32) -> PowRefI32<'a>`

Performs the power operation. Read more

### `impl<'a> From<PowRefI32<'a>> for Rational`[src]

#### `fn from(t: PowRefI32<'a>) -> Rational`

Performs the conversion.

### `impl<'a> Assign<PowRefI32<'a>> for Rational`[src]

#### `fn assign(&mut self, rhs: PowRefI32)`

Peforms the assignement. Read more

### `impl Shl<u32> for Rational`[src]

#### `type Output = Rational`

The resulting type after applying the `<<` operator

#### `fn shl(self, op: u32) -> Rational`

The method for the `<<` operator

### `impl ShlAssign<u32> for Rational`[src]

#### `fn shl_assign(&mut self, op: u32)`

The method for the `<<=` operator

### `impl<'a> Shl<u32> for &'a Rational`[src]

#### `type Output = ShlRefU32<'a>`

The resulting type after applying the `<<` operator

#### `fn shl(self, op: u32) -> ShlRefU32<'a>`

The method for the `<<` operator

### `impl<'a> From<ShlRefU32<'a>> for Rational`[src]

#### `fn from(t: ShlRefU32<'a>) -> Rational`

Performs the conversion.

### `impl<'a> Assign<ShlRefU32<'a>> for Rational`[src]

#### `fn assign(&mut self, rhs: ShlRefU32)`

Peforms the assignement. Read more

### `impl Shr<u32> for Rational`[src]

#### `type Output = Rational`

The resulting type after applying the `>>` operator

#### `fn shr(self, op: u32) -> Rational`

The method for the `>>` operator

### `impl ShrAssign<u32> for Rational`[src]

#### `fn shr_assign(&mut self, op: u32)`

The method for the `>>=` operator

### `impl<'a> Shr<u32> for &'a Rational`[src]

#### `type Output = ShrRefU32<'a>`

The resulting type after applying the `>>` operator

#### `fn shr(self, op: u32) -> ShrRefU32<'a>`

The method for the `>>` operator

### `impl<'a> From<ShrRefU32<'a>> for Rational`[src]

#### `fn from(t: ShrRefU32<'a>) -> Rational`

Performs the conversion.

### `impl<'a> Assign<ShrRefU32<'a>> for Rational`[src]

#### `fn assign(&mut self, rhs: ShrRefU32)`

Peforms the assignement. Read more

### `impl Pow<u32> for Rational`[src]

#### `type Output = Rational`

The resulting type after the power operation.

#### `fn pow(self, op: u32) -> Rational`

Performs the power operation. Read more

### `impl PowAssign<u32> for Rational`[src]

#### `fn pow_assign(&mut self, op: u32)`

Peforms the power operation. Read more

### `impl<'a> Pow<u32> for &'a Rational`[src]

#### `type Output = PowRefU32<'a>`

The resulting type after the power operation.

#### `fn pow(self, op: u32) -> PowRefU32<'a>`

Performs the power operation. Read more

### `impl<'a> From<PowRefU32<'a>> for Rational`[src]

#### `fn from(t: PowRefU32<'a>) -> Rational`

Performs the conversion.

### `impl<'a> Assign<PowRefU32<'a>> for Rational`[src]

#### `fn assign(&mut self, rhs: PowRefU32)`

Peforms the assignement. Read more

### `impl Ord for Rational`[src]

#### `fn cmp(&self, other: &Rational) -> Ordering`

This method returns an `Ordering` between `self` and `other`. Read more

### `impl PartialEq for Rational`[src]

#### `fn eq(&self, other: &Rational) -> bool`

This method tests for `self` and `other` values to be equal, and is used by `==`. Read more

#### `fn ne(&self, other: &Rhs) -> bool`1.0.0

This method tests for `!=`.

### `impl PartialOrd for Rational`[src]

#### `fn partial_cmp(&self, other: &Rational) -> Option<Ordering>`

This method returns an ordering between `self` and `other` values if one exists. Read more

#### `fn lt(&self, other: &Rhs) -> bool`1.0.0

This method tests less than (for `self` and `other`) and is used by the `<` operator. Read more

#### `fn le(&self, other: &Rhs) -> bool`1.0.0

This method tests less than or equal to (for `self` and `other`) and is used by the `<=` operator. Read more

#### `fn gt(&self, other: &Rhs) -> bool`1.0.0

This method tests greater than (for `self` and `other`) and is used by the `>` operator. Read more

#### `fn ge(&self, other: &Rhs) -> bool`1.0.0

This method tests greater than or equal to (for `self` and `other`) and is used by the `>=` operator. Read more

### `impl PartialEq<Integer> for Rational`[src]

#### `fn eq(&self, other: &Integer) -> bool`

This method tests for `self` and `other` values to be equal, and is used by `==`. Read more

#### `fn ne(&self, other: &Rhs) -> bool`1.0.0

This method tests for `!=`.

### `impl PartialOrd<Integer> for Rational`[src]

#### `fn partial_cmp(&self, other: &Integer) -> Option<Ordering>`

This method returns an ordering between `self` and `other` values if one exists. Read more

#### `fn lt(&self, other: &Rhs) -> bool`1.0.0

This method tests less than (for `self` and `other`) and is used by the `<` operator. Read more

#### `fn le(&self, other: &Rhs) -> bool`1.0.0

This method tests less than or equal to (for `self` and `other`) and is used by the `<=` operator. Read more

#### `fn gt(&self, other: &Rhs) -> bool`1.0.0

This method tests greater than (for `self` and `other`) and is used by the `>` operator. Read more

#### `fn ge(&self, other: &Rhs) -> bool`1.0.0

This method tests greater than or equal to (for `self` and `other`) and is used by the `>=` operator. Read more

### `impl PartialEq<i32> for Rational`[src]

#### `fn eq(&self, other: &i32) -> bool`

This method tests for `self` and `other` values to be equal, and is used by `==`. Read more

#### `fn ne(&self, other: &Rhs) -> bool`1.0.0

This method tests for `!=`.

### `impl PartialOrd<i32> for Rational`[src]

#### `fn partial_cmp(&self, other: &i32) -> Option<Ordering>`

This method returns an ordering between `self` and `other` values if one exists. Read more

#### `fn lt(&self, other: &Rhs) -> bool`1.0.0

This method tests less than (for `self` and `other`) and is used by the `<` operator. Read more

#### `fn le(&self, other: &Rhs) -> bool`1.0.0

This method tests less than or equal to (for `self` and `other`) and is used by the `<=` operator. Read more

#### `fn gt(&self, other: &Rhs) -> bool`1.0.0

This method tests greater than (for `self` and `other`) and is used by the `>` operator. Read more

#### `fn ge(&self, other: &Rhs) -> bool`1.0.0

This method tests greater than or equal to (for `self` and `other`) and is used by the `>=` operator. Read more

### `impl PartialEq<u32> for Rational`[src]

#### `fn eq(&self, other: &u32) -> bool`

This method tests for `self` and `other` values to be equal, and is used by `==`. Read more

#### `fn ne(&self, other: &Rhs) -> bool`1.0.0

This method tests for `!=`.

### `impl PartialOrd<u32> for Rational`[src]

#### `fn partial_cmp(&self, other: &u32) -> Option<Ordering>`

This method returns an ordering between `self` and `other` values if one exists. Read more

#### `fn lt(&self, other: &Rhs) -> bool`1.0.0

This method tests less than (for `self` and `other`) and is used by the `<` operator. Read more

#### `fn le(&self, other: &Rhs) -> bool`1.0.0

This method tests less than or equal to (for `self` and `other`) and is used by the `<=` operator. Read more

#### `fn gt(&self, other: &Rhs) -> bool`1.0.0

This method tests greater than (for `self` and `other`) and is used by the `>` operator. Read more

#### `fn ge(&self, other: &Rhs) -> bool`1.0.0

This method tests greater than or equal to (for `self` and `other`) and is used by the `>=` operator. Read more

### `impl PartialEq<i64> for Rational`[src]

#### `fn eq(&self, other: &i64) -> bool`

This method tests for `self` and `other` values to be equal, and is used by `==`. Read more

#### `fn ne(&self, other: &Rhs) -> bool`1.0.0

This method tests for `!=`.

### `impl PartialOrd<i64> for Rational`[src]

#### `fn partial_cmp(&self, other: &i64) -> Option<Ordering>`

This method returns an ordering between `self` and `other` values if one exists. Read more

#### `fn lt(&self, other: &Rhs) -> bool`1.0.0

This method tests less than (for `self` and `other`) and is used by the `<` operator. Read more

#### `fn le(&self, other: &Rhs) -> bool`1.0.0

This method tests less than or equal to (for `self` and `other`) and is used by the `<=` operator. Read more

#### `fn gt(&self, other: &Rhs) -> bool`1.0.0

This method tests greater than (for `self` and `other`) and is used by the `>` operator. Read more

#### `fn ge(&self, other: &Rhs) -> bool`1.0.0

This method tests greater than or equal to (for `self` and `other`) and is used by the `>=` operator. Read more

### `impl PartialEq<u64> for Rational`[src]

#### `fn eq(&self, other: &u64) -> bool`

This method tests for `self` and `other` values to be equal, and is used by `==`. Read more

#### `fn ne(&self, other: &Rhs) -> bool`1.0.0

This method tests for `!=`.

### `impl PartialOrd<u64> for Rational`[src]

#### `fn partial_cmp(&self, other: &u64) -> Option<Ordering>`

This method returns an ordering between `self` and `other` values if one exists. Read more

#### `fn lt(&self, other: &Rhs) -> bool`1.0.0

This method tests less than (for `self` and `other`) and is used by the `<` operator. Read more

#### `fn le(&self, other: &Rhs) -> bool`1.0.0

This method tests less than or equal to (for `self` and `other`) and is used by the `<=` operator. Read more

#### `fn gt(&self, other: &Rhs) -> bool`1.0.0

This method tests greater than (for `self` and `other`) and is used by the `>` operator. Read more

#### `fn ge(&self, other: &Rhs) -> bool`1.0.0

This method tests greater than or equal to (for `self` and `other`) and is used by the `>=` operator. Read more

### `impl PartialEq<(i32, i32)> for Rational`[src]

#### `fn eq(&self, other: &(i32, i32)) -> bool`

This method tests for `self` and `other` values to be equal, and is used by `==`. Read more

#### `fn ne(&self, other: &Rhs) -> bool`1.0.0

This method tests for `!=`.

### `impl PartialOrd<(i32, i32)> for Rational`[src]

#### `fn partial_cmp(&self, other: &(i32, i32)) -> Option<Ordering>`

This method returns an ordering between `self` and `other` values if one exists. Read more

#### `fn lt(&self, other: &Rhs) -> bool`1.0.0

This method tests less than (for `self` and `other`) and is used by the `<` operator. Read more

#### `fn le(&self, other: &Rhs) -> bool`1.0.0

This method tests less than or equal to (for `self` and `other`) and is used by the `<=` operator. Read more

#### `fn gt(&self, other: &Rhs) -> bool`1.0.0

This method tests greater than (for `self` and `other`) and is used by the `>` operator. Read more

#### `fn ge(&self, other: &Rhs) -> bool`1.0.0

This method tests greater than or equal to (for `self` and `other`) and is used by the `>=` operator. Read more

### `impl PartialEq<(i64, i64)> for Rational`[src]

#### `fn eq(&self, other: &(i64, i64)) -> bool`

This method tests for `self` and `other` values to be equal, and is used by `==`. Read more

#### `fn ne(&self, other: &Rhs) -> bool`1.0.0

This method tests for `!=`.

### `impl PartialOrd<(i64, i64)> for Rational`[src]

#### `fn partial_cmp(&self, other: &(i64, i64)) -> Option<Ordering>`

This method returns an ordering between `self` and `other` values if one exists. Read more

#### `fn lt(&self, other: &Rhs) -> bool`1.0.0

This method tests less than (for `self` and `other`) and is used by the `<` operator. Read more

#### `fn le(&self, other: &Rhs) -> bool`1.0.0

This method tests less than or equal to (for `self` and `other`) and is used by the `<=` operator. Read more

#### `fn gt(&self, other: &Rhs) -> bool`1.0.0

This method tests greater than (for `self` and `other`) and is used by the `>` operator. Read more

#### `fn ge(&self, other: &Rhs) -> bool`1.0.0

This method tests greater than or equal to (for `self` and `other`) and is used by the `>=` operator. Read more

### `impl PartialEq<(i32, u32)> for Rational`[src]

#### `fn eq(&self, other: &(i32, u32)) -> bool`

This method tests for `self` and `other` values to be equal, and is used by `==`. Read more

#### `fn ne(&self, other: &Rhs) -> bool`1.0.0

This method tests for `!=`.

### `impl PartialOrd<(i32, u32)> for Rational`[src]

#### `fn partial_cmp(&self, other: &(i32, u32)) -> Option<Ordering>`

This method returns an ordering between `self` and `other` values if one exists. Read more

#### `fn lt(&self, other: &Rhs) -> bool`1.0.0

This method tests less than (for `self` and `other`) and is used by the `<` operator. Read more

#### `fn le(&self, other: &Rhs) -> bool`1.0.0

This method tests less than or equal to (for `self` and `other`) and is used by the `<=` operator. Read more

#### `fn gt(&self, other: &Rhs) -> bool`1.0.0

This method tests greater than (for `self` and `other`) and is used by the `>` operator. Read more

#### `fn ge(&self, other: &Rhs) -> bool`1.0.0

This method tests greater than or equal to (for `self` and `other`) and is used by the `>=` operator. Read more

### `impl PartialEq<(i64, u64)> for Rational`[src]

#### `fn eq(&self, other: &(i64, u64)) -> bool`

This method tests for `self` and `other` values to be equal, and is used by `==`. Read more

#### `fn ne(&self, other: &Rhs) -> bool`1.0.0

This method tests for `!=`.

### `impl PartialOrd<(i64, u64)> for Rational`[src]

#### `fn partial_cmp(&self, other: &(i64, u64)) -> Option<Ordering>`

This method returns an ordering between `self` and `other` values if one exists. Read more

#### `fn lt(&self, other: &Rhs) -> bool`1.0.0

This method tests less than (for `self` and `other`) and is used by the `<` operator. Read more

#### `fn le(&self, other: &Rhs) -> bool`1.0.0

This method tests less than or equal to (for `self` and `other`) and is used by the `<=` operator. Read more

#### `fn gt(&self, other: &Rhs) -> bool`1.0.0

This method tests greater than (for `self` and `other`) and is used by the `>` operator. Read more

#### `fn ge(&self, other: &Rhs) -> bool`1.0.0

This method tests greater than or equal to (for `self` and `other`) and is used by the `>=` operator. Read more

### `impl PartialEq<(u32, i32)> for Rational`[src]

#### `fn eq(&self, other: &(u32, i32)) -> bool`

This method tests for `self` and `other` values to be equal, and is used by `==`. Read more

#### `fn ne(&self, other: &Rhs) -> bool`1.0.0

This method tests for `!=`.

### `impl PartialOrd<(u32, i32)> for Rational`[src]

#### `fn partial_cmp(&self, other: &(u32, i32)) -> Option<Ordering>`

This method returns an ordering between `self` and `other` values if one exists. Read more

#### `fn lt(&self, other: &Rhs) -> bool`1.0.0

This method tests less than (for `self` and `other`) and is used by the `<` operator. Read more

#### `fn le(&self, other: &Rhs) -> bool`1.0.0

This method tests less than or equal to (for `self` and `other`) and is used by the `<=` operator. Read more

#### `fn gt(&self, other: &Rhs) -> bool`1.0.0

This method tests greater than (for `self` and `other`) and is used by the `>` operator. Read more

#### `fn ge(&self, other: &Rhs) -> bool`1.0.0

This method tests greater than or equal to (for `self` and `other`) and is used by the `>=` operator. Read more

### `impl PartialEq<(u64, i64)> for Rational`[src]

#### `fn eq(&self, other: &(u64, i64)) -> bool`

This method tests for `self` and `other` values to be equal, and is used by `==`. Read more

#### `fn ne(&self, other: &Rhs) -> bool`1.0.0

This method tests for `!=`.

### `impl PartialOrd<(u64, i64)> for Rational`[src]

#### `fn partial_cmp(&self, other: &(u64, i64)) -> Option<Ordering>`

This method returns an ordering between `self` and `other` values if one exists. Read more

#### `fn lt(&self, other: &Rhs) -> bool`1.0.0

This method tests less than (for `self` and `other`) and is used by the `<` operator. Read more

#### `fn le(&self, other: &Rhs) -> bool`1.0.0

This method tests less than or equal to (for `self` and `other`) and is used by the `<=` operator. Read more

#### `fn gt(&self, other: &Rhs) -> bool`1.0.0

This method tests greater than (for `self` and `other`) and is used by the `>` operator. Read more

#### `fn ge(&self, other: &Rhs) -> bool`1.0.0

This method tests greater than or equal to (for `self` and `other`) and is used by the `>=` operator. Read more

### `impl PartialEq<(u32, u32)> for Rational`[src]

#### `fn eq(&self, other: &(u32, u32)) -> bool`

This method tests for `self` and `other` values to be equal, and is used by `==`. Read more

#### `fn ne(&self, other: &Rhs) -> bool`1.0.0

This method tests for `!=`.

### `impl PartialOrd<(u32, u32)> for Rational`[src]

#### `fn partial_cmp(&self, other: &(u32, u32)) -> Option<Ordering>`

This method returns an ordering between `self` and `other` values if one exists. Read more

#### `fn lt(&self, other: &Rhs) -> bool`1.0.0

This method tests less than (for `self` and `other`) and is used by the `<` operator. Read more

#### `fn le(&self, other: &Rhs) -> bool`1.0.0

This method tests less than or equal to (for `self` and `other`) and is used by the `<=` operator. Read more

#### `fn gt(&self, other: &Rhs) -> bool`1.0.0

This method tests greater than (for `self` and `other`) and is used by the `>` operator. Read more

#### `fn ge(&self, other: &Rhs) -> bool`1.0.0

This method tests greater than or equal to (for `self` and `other`) and is used by the `>=` operator. Read more

### `impl PartialEq<(u64, u64)> for Rational`[src]

#### `fn eq(&self, other: &(u64, u64)) -> bool`

This method tests for `self` and `other` values to be equal, and is used by `==`. Read more

#### `fn ne(&self, other: &Rhs) -> bool`1.0.0

This method tests for `!=`.

### `impl PartialOrd<(u64, u64)> for Rational`[src]

#### `fn partial_cmp(&self, other: &(u64, u64)) -> Option<Ordering>`

This method returns an ordering between `self` and `other` values if one exists. Read more

#### `fn lt(&self, other: &Rhs) -> bool`1.0.0

This method tests less than (for `self` and `other`) and is used by the `<` operator. Read more

#### `fn le(&self, other: &Rhs) -> bool`1.0.0

This method tests less than or equal to (for `self` and `other`) and is used by the `<=` operator. Read more

#### `fn gt(&self, other: &Rhs) -> bool`1.0.0

This method tests greater than (for `self` and `other`) and is used by the `>` operator. Read more

#### `fn ge(&self, other: &Rhs) -> bool`1.0.0

This method tests greater than or equal to (for `self` and `other`) and is used by the `>=` operator. Read more

### `impl<'a> From<ValidRational<'a>> for Rational`[src]

#### `fn from(t: ValidRational<'a>) -> Rational`

Performs the conversion.

### `impl<'a> Assign<ValidRational<'a>> for Rational`[src]

#### `fn assign(&mut self, rhs: ValidRational)`

Peforms the assignement. Read more

### `impl<'a> Add<Float> for &'a Rational`[src]

#### `type Output = Float`

The resulting type after applying the `+` operator

#### `fn add(self, rhs: Float) -> Float`

The method for the `+` operator

### `impl<'a> AddRound<Float> for &'a Rational`[src]

#### `type Round = Round`

The rounding method.

#### `type Ordering = Ordering`

The direction from rounding.

#### `type Output = Float`

The resulting type after the addition.

#### `fn add_round(self, rhs: Float, round: Round) -> (Float, Ordering)`

Performs the addition. Read more

### `impl Add<Float> for Rational`[src]

#### `type Output = Float`

The resulting type after applying the `+` operator

#### `fn add(self, rhs: Float) -> Float`

The method for the `+` operator

### `impl AddRound<Float> for Rational`[src]

#### `type Round = Round`

The rounding method.

#### `type Ordering = Ordering`

The direction from rounding.

#### `type Output = Float`

The resulting type after the addition.

#### `fn add_round(self, rhs: Float, round: Round) -> (Float, Ordering)`

Performs the addition. Read more

### `impl<'a> Add<&'a Float> for &'a Rational`[src]

#### `type Output = AddRefRational<'a>`

The resulting type after applying the `+` operator

#### `fn add(self, rhs: &'a Float) -> AddRefRational<'a>`

The method for the `+` operator

### `impl<'a> Add<&'a Float> for Rational`[src]

#### `type Output = AddRefRationalOwn<'a>`

The resulting type after applying the `+` operator

#### `fn add(self, rhs: &'a Float) -> AddRefRationalOwn<'a>`

The method for the `+` operator

### `impl<'a> Sub<Float> for &'a Rational`[src]

#### `type Output = Float`

The resulting type after applying the `-` operator

#### `fn sub(self, rhs: Float) -> Float`

The method for the `-` operator

### `impl<'a> SubRound<Float> for &'a Rational`[src]

#### `type Round = Round`

The rounding method.

#### `type Ordering = Ordering`

The direction from rounding.

#### `type Output = Float`

The resulting type after the subtraction.

#### `fn sub_round(self, rhs: Float, round: Round) -> (Float, Ordering)`

Performs the subtraction. Read more

### `impl Sub<Float> for Rational`[src]

#### `type Output = Float`

The resulting type after applying the `-` operator

#### `fn sub(self, rhs: Float) -> Float`

The method for the `-` operator

### `impl SubRound<Float> for Rational`[src]

#### `type Round = Round`

The rounding method.

#### `type Ordering = Ordering`

The direction from rounding.

#### `type Output = Float`

The resulting type after the subtraction.

#### `fn sub_round(self, rhs: Float, round: Round) -> (Float, Ordering)`

Performs the subtraction. Read more

### `impl<'a> Sub<&'a Float> for &'a Rational`[src]

#### `type Output = SubRefRationalOwn<'a>`

The resulting type after applying the `-` operator

#### `fn sub(self, rhs: &'a Float) -> SubRefRationalOwn<'a>`

The method for the `-` operator

### `impl<'a> Sub<&'a Float> for Rational`[src]

#### `type Output = SubFromRefRationalOwn<'a>`

The resulting type after applying the `-` operator

#### `fn sub(self, rhs: &'a Float) -> SubFromRefRationalOwn<'a>`

The method for the `-` operator

### `impl<'a> Mul<Float> for &'a Rational`[src]

#### `type Output = Float`

The resulting type after applying the `*` operator

#### `fn mul(self, rhs: Float) -> Float`

The method for the `*` operator

### `impl<'a> MulRound<Float> for &'a Rational`[src]

#### `type Round = Round`

The rounding method.

#### `type Ordering = Ordering`

The direction from rounding.

#### `type Output = Float`

The resulting type after the multiplication.

#### `fn mul_round(self, rhs: Float, round: Round) -> (Float, Ordering)`

Performs the multiplication. Read more

### `impl Mul<Float> for Rational`[src]

#### `type Output = Float`

The resulting type after applying the `*` operator

#### `fn mul(self, rhs: Float) -> Float`

The method for the `*` operator

### `impl MulRound<Float> for Rational`[src]

#### `type Round = Round`

The rounding method.

#### `type Ordering = Ordering`

The direction from rounding.

#### `type Output = Float`

The resulting type after the multiplication.

#### `fn mul_round(self, rhs: Float, round: Round) -> (Float, Ordering)`

Performs the multiplication. Read more

### `impl<'a> Mul<&'a Float> for &'a Rational`[src]

#### `type Output = MulRefRational<'a>`

The resulting type after applying the `*` operator

#### `fn mul(self, rhs: &'a Float) -> MulRefRational<'a>`

The method for the `*` operator

### `impl<'a> Mul<&'a Float> for Rational`[src]

#### `type Output = MulRefRationalOwn<'a>`

The resulting type after applying the `*` operator

#### `fn mul(self, rhs: &'a Float) -> MulRefRationalOwn<'a>`

The method for the `*` operator

### `impl<'a> Div<Float> for &'a Rational`[src]

#### `type Output = Float`

The resulting type after applying the `/` operator

#### `fn div(self, rhs: Float) -> Float`

The method for the `/` operator

### `impl<'a> DivRound<Float> for &'a Rational`[src]

#### `type Round = Round`

The rounding method.

#### `type Ordering = Ordering`

The direction from rounding.

#### `type Output = Float`

The resulting type after the division.

#### `fn div_round(self, rhs: Float, round: Round) -> (Float, Ordering)`

Performs the division. Read more

### `impl Div<Float> for Rational`[src]

#### `type Output = Float`

The resulting type after applying the `/` operator

#### `fn div(self, rhs: Float) -> Float`

The method for the `/` operator

### `impl DivRound<Float> for Rational`[src]

#### `type Round = Round`

The rounding method.

#### `type Ordering = Ordering`

The direction from rounding.

#### `type Output = Float`

The resulting type after the division.

#### `fn div_round(self, rhs: Float, round: Round) -> (Float, Ordering)`

Performs the division. Read more

### `impl<'a> Div<&'a Float> for &'a Rational`[src]

#### `type Output = DivRefRationalOwn<'a>`

The resulting type after applying the `/` operator

#### `fn div(self, rhs: &'a Float) -> DivRefRationalOwn<'a>`

The method for the `/` operator

### `impl<'a> Div<&'a Float> for Rational`[src]

#### `type Output = DivFromRefRationalOwn<'a>`

The resulting type after applying the `/` operator

#### `fn div(self, rhs: &'a Float) -> DivFromRefRationalOwn<'a>`

The method for the `/` operator

### `impl PartialEq<Float> for Rational`[src]

#### `fn eq(&self, other: &Float) -> bool`

This method tests for `self` and `other` values to be equal, and is used by `==`. Read more

#### `fn ne(&self, other: &Rhs) -> bool`1.0.0

This method tests for `!=`.

### `impl PartialOrd<Float> for Rational`[src]

#### `fn partial_cmp(&self, other: &Float) -> Option<Ordering>`

This method returns an ordering between `self` and `other` values if one exists. Read more

#### `fn lt(&self, other: &Rhs) -> bool`1.0.0

This method tests less than (for `self` and `other`) and is used by the `<` operator. Read more

#### `fn le(&self, other: &Rhs) -> bool`1.0.0

This method tests less than or equal to (for `self` and `other`) and is used by the `<=` operator. Read more

#### `fn gt(&self, other: &Rhs) -> bool`1.0.0

This method tests greater than (for `self` and `other`) and is used by the `>` operator. Read more

#### `fn ge(&self, other: &Rhs) -> bool`1.0.0

This method tests greater than or equal to (for `self` and `other`) and is used by the `>=` operator. Read more