Struct reckoner::Rational[][src]

#[repr(transparent)]
pub struct Rational { /* fields omitted */ }

Multiple precision rational value.

Implementations

impl Rational[src]

pub fn add(&self, other: &Self) -> Self[src]

Add two rational values and return the result.

pub fn add_integer(&self, other: &Integer) -> Self[src]

Add a rational value and an integer value and return the rational result.

pub fn add_assign(&mut self, other: &Self)[src]

Add two rationals and assign the result to self.

pub fn add_assign_integer(&mut self, other: &Integer)[src]

Add a rational value and an integer value and assign the result to self.

pub fn subtract(&self, other: &Self) -> Self[src]

Subtract two rational values and return the result.

pub fn subtract_integer(&self, other: &Integer) -> Self[src]

Subtract a rational value and an integer value and return the rational result.

pub fn subtract_assign(&mut self, other: &Self)[src]

Subtract two rationals and assign the result to self.

pub fn subtract_assign_integer(&mut self, other: &Integer)[src]

Subtract a rational value and an integer value and assign the result to self.

pub fn multiply(&self, other: &Self) -> Self[src]

Multiply two rational values and return the result.

pub fn multiply_integer(&self, other: &Integer) -> Self[src]

Multiply a rational value and an integer value and return the rational result.

pub fn multiply_assign(&mut self, other: &Self)[src]

Multiply two rationals and assign the result to self.

pub fn multiply_assign_integer(&mut self, other: &Integer)[src]

Multiply a rational value and an integer value and assign the result to self.

pub fn divide(&self, other: &Self) -> Self[src]

Divide two rational values and return the result.

pub fn divide_integer(&self, other: &Integer) -> Self[src]

Divide a rational value and an integer value and return the rational result.

pub fn divide_assign(&mut self, other: &Self)[src]

Divide two rationals and assign the result to self.

pub fn divide_assign_integer(&mut self, other: &Integer)[src]

Divide a rational value and an integer value and assign the result to self.

pub fn absolute_value(&self) -> Self[src]

Return the absolute value

pub fn absolute_value_assign(&mut self)[src]

Assign the absolute value to self

pub fn negate(&self) -> Self[src]

Return the additive inverse

pub fn negate_assign(&mut self)[src]

Assign the additive inverse to self

pub fn reciprocal(&self) -> Self[src]

Return the multiplicative inverse

pub fn reciprocal_assign(&mut self)[src]

Assign the multiplicative inverse to self

impl Rational[src]

pub fn new() -> Self[src]

Create a new rational with a default value of zero (0/1).

Example

use reckoner::Rational;

let r = Rational::new();

assert_eq!(r, (0, 1));

pub unsafe fn from_raw(raw: *mut mpq_t) -> Self[src]

Construct a Rational from a raw non-null pointer to creachadair_imath_sys::mpq_t.

Safety

This function must only every be called once for a given pointer, and the pointer must point to an initialized creachadair_imath_sys::mpq_t struct. The recommendation is to only use raw pointers from the Rational::into_raw function.

In ths context, initialized means that the creachadair_imath_sys::mpq_t has been the argument of a call to creachadair_imath_sys::mp_rat_init.

Example

use creachadair_imath_sys::{mp_rat_zero, MP_OK};
use reckoner::Rational;

let a = Rational::from((456, 123));

assert_eq!(a, (456, 123));

let a_raw = Rational::into_raw(a);

unsafe { mp_rat_zero(a_raw) };

let a = unsafe { Rational::from_raw(a_raw) };

assert_eq!(a, (0, 1));

pub fn into_raw(rational: Rational) -> *mut mpq_t[src]

Consumes the Rational, returning a wrapped raw pointer.

Example

use creachadair_imath_sys::{mp_rat_add, MP_OK};
use reckoner::Rational;

let a = Rational::from((377, 500));
let b = Rational::from((123, 500));
let c = Rational::new();

let a_raw = Rational::into_raw(a);
let b_raw = Rational::into_raw(b);
let c_raw = Rational::into_raw(c);

let op_res = unsafe { mp_rat_add(a_raw, b_raw, c_raw) };

if op_res != unsafe { MP_OK } {
    panic!("Operation failed.")
}

let a = unsafe { Rational::from_raw(a_raw) };
let b = unsafe { Rational::from_raw(b_raw) };
let c = unsafe { Rational::from_raw(c_raw) };

assert_eq!(a, (377, 500));
assert_eq!(b, (123, 500));
assert_eq!(c, (500, 500));

pub fn reduce(&mut self)[src]

Reduces r in-place to lowest terms and canonical form.

Zero is represented as 0/1, one as 1/1, and signs are adjusted so that the sign of the value is carried by the numerator.

Example

use reckoner::Rational;

let mut a = Rational::from((24, 2));
let mut b = Rational::from((24, 3));
let mut c = Rational::from((24, 4));

a.reduce();
b.reduce();
c.reduce();

assert_eq!(a, (12, 1));
assert_eq!(b, (8, 1));
assert_eq!(c, (6, 1));

pub fn zero(&mut self)[src]

Set value of integer to zero

Example

use reckoner::Rational;

let mut r = Rational::from((1234567u128, 1346172348u64));

r.zero();

assert_eq!(r, (0, 1));

pub fn is_integer(&self) -> bool[src]

Returns true if the denominator is 1.

Example

use reckoner::Rational;

assert!(Rational::from((0, 1)).is_integer());
assert!(Rational::from((1, 1)).is_integer());
assert!(!Rational::from((3, 25)).is_integer());

pub fn compare(&self, rhs: &Self) -> Ordering[src]

Compare two rationals

Example

use core::cmp::Ordering;
use reckoner::Rational;

let a = Rational::from((123, 500));
let b = Rational::from((377, 500));

assert_eq!(a.compare(&b), Ordering::Less);
assert_eq!(b.compare(&a), Ordering::Greater);
assert_eq!(a.compare(&a), Ordering::Equal);

pub fn compare_magnitude(&self, rhs: &Self) -> Ordering[src]

Compare the magnitude of two rationals, not taking sign into account.

Example

use core::cmp::Ordering;
use reckoner::Rational;

let a = Rational::from((123, 500));
let b = Rational::from((-377, 500));

assert_eq!(a.compare(&b), Ordering::Greater);
assert_eq!(a.compare_magnitude(&b), Ordering::Less);

pub fn compare_zero(&self) -> Ordering[src]

Compare a rational to zero.

Example

use core::cmp::Ordering;
use reckoner::Rational;

let a = Rational::from((123, 500));
let b = Rational::from((-377, 500));

assert_eq!(a.compare_zero(), Ordering::Greater);
assert_eq!(b.compare_zero(), Ordering::Less);

pub fn numerator(&self) -> Integer[src]

Return a copy of the numerator of the rational value

Example

use reckoner::Rational;

let a = Rational::from((34256, 54587));

assert_eq!(a.numerator(), 34256);

pub fn denominator(&self) -> Integer[src]

Return a copy of the denominator of the rational value

Example

use reckoner::Rational;

let a = Rational::from((34256, 54587));

assert_eq!(a.denominator(), 54587);

pub fn copy_to(&self, other: &mut Self)[src]

Replaces the value of other with a copy of the value of self. No new memory is allocated unless self has more significant digits than other has allocated.

Example

use reckoner::Rational;

let a = Rational::from((34256, 54587));
let mut b = Rational::new();

a.copy_to(&mut b);

assert_eq!(a, b);
assert_eq!(b, (34256, 54587));

pub fn to_decimal(&self, rounding_mode: RoundMode, max_precision: u16) -> String[src]

Converts the value of self to a string in base-10 decimal-point notation. It generates max_precision digits of precision and takes a RoundMode argument that determines how the ratio will be converted to decimal.

Example

use reckoner::{Rational, RoundMode};

let r = Rational::from((1146408, 364913));

assert_eq!(r.to_decimal(RoundMode::HalfUp, 6), "3.141593");
assert_eq!(r.to_decimal(RoundMode::HalfUp, 5), "3.14159");
assert_eq!(r.to_decimal(RoundMode::HalfUp, 4), "3.1416");
assert_eq!(r.to_decimal(RoundMode::HalfUp, 3), "3.142");

Trait Implementations

impl Add<&'_ Integer> for Rational[src]

type Output = Rational

The resulting type after applying the + operator.

impl Add<&'_ Integer> for &Rational[src]

type Output = Rational

The resulting type after applying the + operator.

impl Add<&'_ Rational> for Rational[src]

type Output = Rational

The resulting type after applying the + operator.

impl Add<&'_ Rational> for &Rational[src]

type Output = Rational

The resulting type after applying the + operator.

impl Add<&'_ Rational> for Integer[src]

type Output = Rational

The resulting type after applying the + operator.

impl Add<&'_ Rational> for &Integer[src]

type Output = Rational

The resulting type after applying the + operator.

impl Add<&'_ i128> for Rational[src]

type Output = Rational

The resulting type after applying the + operator.

impl Add<&'_ i128> for &Rational[src]

type Output = Rational

The resulting type after applying the + operator.

impl Add<&'_ i16> for Rational[src]

type Output = Rational

The resulting type after applying the + operator.

impl Add<&'_ i16> for &Rational[src]

type Output = Rational

The resulting type after applying the + operator.

impl Add<&'_ i32> for Rational[src]

type Output = Rational

The resulting type after applying the + operator.

impl Add<&'_ i32> for &Rational[src]

type Output = Rational

The resulting type after applying the + operator.

impl Add<&'_ i64> for Rational[src]

type Output = Rational

The resulting type after applying the + operator.

impl Add<&'_ i64> for &Rational[src]

type Output = Rational

The resulting type after applying the + operator.

impl Add<&'_ i8> for Rational[src]

type Output = Rational

The resulting type after applying the + operator.

impl Add<&'_ i8> for &Rational[src]

type Output = Rational

The resulting type after applying the + operator.

impl Add<&'_ u128> for Rational[src]

type Output = Rational

The resulting type after applying the + operator.

impl Add<&'_ u128> for &Rational[src]

type Output = Rational

The resulting type after applying the + operator.

impl Add<&'_ u16> for Rational[src]

type Output = Rational

The resulting type after applying the + operator.

impl Add<&'_ u16> for &Rational[src]

type Output = Rational

The resulting type after applying the + operator.

impl Add<&'_ u32> for Rational[src]

type Output = Rational

The resulting type after applying the + operator.

impl Add<&'_ u32> for &Rational[src]

type Output = Rational

The resulting type after applying the + operator.

impl Add<&'_ u64> for Rational[src]

type Output = Rational

The resulting type after applying the + operator.

impl Add<&'_ u64> for &Rational[src]

type Output = Rational

The resulting type after applying the + operator.

impl Add<&'_ u8> for Rational[src]

type Output = Rational

The resulting type after applying the + operator.

impl Add<&'_ u8> for &Rational[src]

type Output = Rational

The resulting type after applying the + operator.

impl Add<Integer> for Rational[src]

type Output = Rational

The resulting type after applying the + operator.

impl Add<Integer> for &Rational[src]

type Output = Rational

The resulting type after applying the + operator.

impl Add<Rational> for Rational[src]

type Output = Rational

The resulting type after applying the + operator.

impl Add<Rational> for &Rational[src]

type Output = Rational

The resulting type after applying the + operator.

impl Add<Rational> for Integer[src]

type Output = Rational

The resulting type after applying the + operator.

impl Add<Rational> for &Integer[src]

type Output = Rational

The resulting type after applying the + operator.

impl Add<i128> for Rational[src]

type Output = Rational

The resulting type after applying the + operator.

impl Add<i128> for &Rational[src]

type Output = Rational

The resulting type after applying the + operator.

impl Add<i16> for Rational[src]

type Output = Rational

The resulting type after applying the + operator.

impl Add<i16> for &Rational[src]

type Output = Rational

The resulting type after applying the + operator.

impl Add<i32> for Rational[src]

type Output = Rational

The resulting type after applying the + operator.

impl Add<i32> for &Rational[src]

type Output = Rational

The resulting type after applying the + operator.

impl Add<i64> for Rational[src]

type Output = Rational

The resulting type after applying the + operator.

impl Add<i64> for &Rational[src]

type Output = Rational

The resulting type after applying the + operator.

impl Add<i8> for Rational[src]

type Output = Rational

The resulting type after applying the + operator.

impl Add<i8> for &Rational[src]

type Output = Rational

The resulting type after applying the + operator.

impl Add<u128> for Rational[src]

type Output = Rational

The resulting type after applying the + operator.

impl Add<u128> for &Rational[src]

type Output = Rational

The resulting type after applying the + operator.

impl Add<u16> for Rational[src]

type Output = Rational

The resulting type after applying the + operator.

impl Add<u16> for &Rational[src]

type Output = Rational

The resulting type after applying the + operator.

impl Add<u32> for Rational[src]

type Output = Rational

The resulting type after applying the + operator.

impl Add<u32> for &Rational[src]

type Output = Rational

The resulting type after applying the + operator.

impl Add<u64> for Rational[src]

type Output = Rational

The resulting type after applying the + operator.

impl Add<u64> for &Rational[src]

type Output = Rational

The resulting type after applying the + operator.

impl Add<u8> for Rational[src]

type Output = Rational

The resulting type after applying the + operator.

impl Add<u8> for &Rational[src]

type Output = Rational

The resulting type after applying the + operator.

impl AddAssign<&'_ Integer> for Rational[src]

impl AddAssign<&'_ Rational> for Rational[src]

impl AddAssign<&'_ i128> for Rational[src]

impl AddAssign<&'_ i16> for Rational[src]

impl AddAssign<&'_ i32> for Rational[src]

impl AddAssign<&'_ i64> for Rational[src]

impl AddAssign<&'_ i8> for Rational[src]

impl AddAssign<&'_ u128> for Rational[src]

impl AddAssign<&'_ u16> for Rational[src]

impl AddAssign<&'_ u32> for Rational[src]

impl AddAssign<&'_ u64> for Rational[src]

impl AddAssign<&'_ u8> for Rational[src]

impl AddAssign<Integer> for Rational[src]

impl AddAssign<Rational> for Rational[src]

impl AddAssign<i128> for Rational[src]

impl AddAssign<i16> for Rational[src]

impl AddAssign<i32> for Rational[src]

impl AddAssign<i64> for Rational[src]

impl AddAssign<i8> for Rational[src]

impl AddAssign<u128> for Rational[src]

impl AddAssign<u16> for Rational[src]

impl AddAssign<u32> for Rational[src]

impl AddAssign<u64> for Rational[src]

impl AddAssign<u8> for Rational[src]

impl Clone for Rational[src]

impl Debug for Rational[src]

impl Default for Rational[src]

impl Display for Rational[src]

impl Div<&'_ Integer> for Rational[src]

type Output = Rational

The resulting type after applying the / operator.

impl Div<&'_ Integer> for &Rational[src]

type Output = Rational

The resulting type after applying the / operator.

impl Div<&'_ Rational> for Rational[src]

type Output = Rational

The resulting type after applying the / operator.

impl Div<&'_ Rational> for &Rational[src]

type Output = Rational

The resulting type after applying the / operator.

impl Div<&'_ Rational> for Integer[src]

type Output = Rational

The resulting type after applying the / operator.

impl Div<&'_ Rational> for &Integer[src]

type Output = Rational

The resulting type after applying the / operator.

impl Div<&'_ i128> for Rational[src]

type Output = Rational

The resulting type after applying the / operator.

impl Div<&'_ i128> for &Rational[src]

type Output = Rational

The resulting type after applying the / operator.

impl Div<&'_ i16> for Rational[src]

type Output = Rational

The resulting type after applying the / operator.

impl Div<&'_ i16> for &Rational[src]

type Output = Rational

The resulting type after applying the / operator.

impl Div<&'_ i32> for Rational[src]

type Output = Rational

The resulting type after applying the / operator.

impl Div<&'_ i32> for &Rational[src]

type Output = Rational

The resulting type after applying the / operator.

impl Div<&'_ i64> for Rational[src]

type Output = Rational

The resulting type after applying the / operator.

impl Div<&'_ i64> for &Rational[src]

type Output = Rational

The resulting type after applying the / operator.

impl Div<&'_ i8> for Rational[src]

type Output = Rational

The resulting type after applying the / operator.

impl Div<&'_ i8> for &Rational[src]

type Output = Rational

The resulting type after applying the / operator.

impl Div<&'_ u128> for Rational[src]

type Output = Rational

The resulting type after applying the / operator.

impl Div<&'_ u128> for &Rational[src]

type Output = Rational

The resulting type after applying the / operator.

impl Div<&'_ u16> for Rational[src]

type Output = Rational

The resulting type after applying the / operator.

impl Div<&'_ u16> for &Rational[src]

type Output = Rational

The resulting type after applying the / operator.

impl Div<&'_ u32> for Rational[src]

type Output = Rational

The resulting type after applying the / operator.

impl Div<&'_ u32> for &Rational[src]

type Output = Rational

The resulting type after applying the / operator.

impl Div<&'_ u64> for Rational[src]

type Output = Rational

The resulting type after applying the / operator.

impl Div<&'_ u64> for &Rational[src]

type Output = Rational

The resulting type after applying the / operator.

impl Div<&'_ u8> for Rational[src]

type Output = Rational

The resulting type after applying the / operator.

impl Div<&'_ u8> for &Rational[src]

type Output = Rational

The resulting type after applying the / operator.

impl Div<Integer> for Rational[src]

type Output = Rational

The resulting type after applying the / operator.

impl Div<Integer> for &Rational[src]

type Output = Rational

The resulting type after applying the / operator.

impl Div<Rational> for Rational[src]

type Output = Rational

The resulting type after applying the / operator.

impl Div<Rational> for &Rational[src]

type Output = Rational

The resulting type after applying the / operator.

impl Div<Rational> for Integer[src]

type Output = Rational

The resulting type after applying the / operator.

impl Div<Rational> for &Integer[src]

type Output = Rational

The resulting type after applying the / operator.

impl Div<i128> for Rational[src]

type Output = Rational

The resulting type after applying the / operator.

impl Div<i128> for &Rational[src]

type Output = Rational

The resulting type after applying the / operator.

impl Div<i16> for Rational[src]

type Output = Rational

The resulting type after applying the / operator.

impl Div<i16> for &Rational[src]

type Output = Rational

The resulting type after applying the / operator.

impl Div<i32> for Rational[src]

type Output = Rational

The resulting type after applying the / operator.

impl Div<i32> for &Rational[src]

type Output = Rational

The resulting type after applying the / operator.

impl Div<i64> for Rational[src]

type Output = Rational

The resulting type after applying the / operator.

impl Div<i64> for &Rational[src]

type Output = Rational

The resulting type after applying the / operator.

impl Div<i8> for Rational[src]

type Output = Rational

The resulting type after applying the / operator.

impl Div<i8> for &Rational[src]

type Output = Rational

The resulting type after applying the / operator.

impl Div<u128> for Rational[src]

type Output = Rational

The resulting type after applying the / operator.

impl Div<u128> for &Rational[src]

type Output = Rational

The resulting type after applying the / operator.

impl Div<u16> for Rational[src]

type Output = Rational

The resulting type after applying the / operator.

impl Div<u16> for &Rational[src]

type Output = Rational

The resulting type after applying the / operator.

impl Div<u32> for Rational[src]

type Output = Rational

The resulting type after applying the / operator.

impl Div<u32> for &Rational[src]

type Output = Rational

The resulting type after applying the / operator.

impl Div<u64> for Rational[src]

type Output = Rational

The resulting type after applying the / operator.

impl Div<u64> for &Rational[src]

type Output = Rational

The resulting type after applying the / operator.

impl Div<u8> for Rational[src]

type Output = Rational

The resulting type after applying the / operator.

impl Div<u8> for &Rational[src]

type Output = Rational

The resulting type after applying the / operator.

impl DivAssign<&'_ Integer> for Rational[src]

impl DivAssign<&'_ Rational> for Rational[src]

impl DivAssign<&'_ i128> for Rational[src]

impl DivAssign<&'_ i16> for Rational[src]

impl DivAssign<&'_ i32> for Rational[src]

impl DivAssign<&'_ i64> for Rational[src]

impl DivAssign<&'_ i8> for Rational[src]

impl DivAssign<&'_ u128> for Rational[src]

impl DivAssign<&'_ u16> for Rational[src]

impl DivAssign<&'_ u32> for Rational[src]

impl DivAssign<&'_ u64> for Rational[src]

impl DivAssign<&'_ u8> for Rational[src]

impl DivAssign<Integer> for Rational[src]

impl DivAssign<Rational> for Rational[src]

impl DivAssign<i128> for Rational[src]

impl DivAssign<i16> for Rational[src]

impl DivAssign<i32> for Rational[src]

impl DivAssign<i64> for Rational[src]

impl DivAssign<i8> for Rational[src]

impl DivAssign<u128> for Rational[src]

impl DivAssign<u16> for Rational[src]

impl DivAssign<u32> for Rational[src]

impl DivAssign<u64> for Rational[src]

impl DivAssign<u8> for Rational[src]

impl Drop for Rational[src]

impl Eq for Rational[src]

impl From<&'_ (Integer, Integer)> for Rational[src]

impl From<&'_ Integer> for Rational[src]

impl From<&'_ i128> for Rational[src]

impl From<&'_ i16> for Rational[src]

impl From<&'_ i32> for Rational[src]

impl From<&'_ i64> for Rational[src]

impl From<&'_ i8> for Rational[src]

impl From<&'_ u128> for Rational[src]

impl From<&'_ u16> for Rational[src]

impl From<&'_ u32> for Rational[src]

impl From<&'_ u64> for Rational[src]

impl From<&'_ u8> for Rational[src]

impl<'a, A, B> From<&'a (A, B)> for Rational where
    &'a A: Into<Integer>,
    &'a B: Into<Integer>, 
[src]

impl<A, B> From<(A, B)> for Rational where
    A: Into<Integer>,
    B: Into<Integer>, 
[src]

impl From<Integer> for Rational[src]

impl From<i128> for Rational[src]

impl From<i16> for Rational[src]

impl From<i32> for Rational[src]

impl From<i64> for Rational[src]

impl From<i8> for Rational[src]

impl From<u128> for Rational[src]

impl From<u16> for Rational[src]

impl From<u32> for Rational[src]

impl From<u64> for Rational[src]

impl From<u8> for Rational[src]

impl FromStr for Rational[src]

Parse a rational value from a string having one of the following formats, each with an optional leading sign flag:

  • n, integer format, e.g. “123”
  • n/d, ratio format, e.g., “-12/5”
  • z.ffff, decimal format, e.g., “1.627”

After successfully parsing, the rational will be reduced by factoring out common multiples of the numerator and denominators, as if Rational::reduce was called on the value.

type Err = Error

The associated error which can be returned from parsing.

impl Mul<&'_ Integer> for Rational[src]

type Output = Rational

The resulting type after applying the * operator.

impl Mul<&'_ Integer> for &Rational[src]

type Output = Rational

The resulting type after applying the * operator.

impl Mul<&'_ Rational> for Rational[src]

type Output = Rational

The resulting type after applying the * operator.

impl Mul<&'_ Rational> for &Rational[src]

type Output = Rational

The resulting type after applying the * operator.

impl Mul<&'_ Rational> for Integer[src]

type Output = Rational

The resulting type after applying the * operator.

impl Mul<&'_ Rational> for &Integer[src]

type Output = Rational

The resulting type after applying the * operator.

impl Mul<&'_ i128> for Rational[src]

type Output = Rational

The resulting type after applying the * operator.

impl Mul<&'_ i128> for &Rational[src]

type Output = Rational

The resulting type after applying the * operator.

impl Mul<&'_ i16> for Rational[src]

type Output = Rational

The resulting type after applying the * operator.

impl Mul<&'_ i16> for &Rational[src]

type Output = Rational

The resulting type after applying the * operator.

impl Mul<&'_ i32> for Rational[src]

type Output = Rational

The resulting type after applying the * operator.

impl Mul<&'_ i32> for &Rational[src]

type Output = Rational

The resulting type after applying the * operator.

impl Mul<&'_ i64> for Rational[src]

type Output = Rational

The resulting type after applying the * operator.

impl Mul<&'_ i64> for &Rational[src]

type Output = Rational

The resulting type after applying the * operator.

impl Mul<&'_ i8> for Rational[src]

type Output = Rational

The resulting type after applying the * operator.

impl Mul<&'_ i8> for &Rational[src]

type Output = Rational

The resulting type after applying the * operator.

impl Mul<&'_ u128> for Rational[src]

type Output = Rational

The resulting type after applying the * operator.

impl Mul<&'_ u128> for &Rational[src]

type Output = Rational

The resulting type after applying the * operator.

impl Mul<&'_ u16> for Rational[src]

type Output = Rational

The resulting type after applying the * operator.

impl Mul<&'_ u16> for &Rational[src]

type Output = Rational

The resulting type after applying the * operator.

impl Mul<&'_ u32> for Rational[src]

type Output = Rational

The resulting type after applying the * operator.

impl Mul<&'_ u32> for &Rational[src]

type Output = Rational

The resulting type after applying the * operator.

impl Mul<&'_ u64> for Rational[src]

type Output = Rational

The resulting type after applying the * operator.

impl Mul<&'_ u64> for &Rational[src]

type Output = Rational

The resulting type after applying the * operator.

impl Mul<&'_ u8> for Rational[src]

type Output = Rational

The resulting type after applying the * operator.

impl Mul<&'_ u8> for &Rational[src]

type Output = Rational

The resulting type after applying the * operator.

impl Mul<Integer> for Rational[src]

type Output = Rational

The resulting type after applying the * operator.

impl Mul<Integer> for &Rational[src]

type Output = Rational

The resulting type after applying the * operator.

impl Mul<Rational> for Rational[src]

type Output = Rational

The resulting type after applying the * operator.

impl Mul<Rational> for &Rational[src]

type Output = Rational

The resulting type after applying the * operator.

impl Mul<Rational> for Integer[src]

type Output = Rational

The resulting type after applying the * operator.

impl Mul<Rational> for &Integer[src]

type Output = Rational

The resulting type after applying the * operator.

impl Mul<i128> for Rational[src]

type Output = Rational

The resulting type after applying the * operator.

impl Mul<i128> for &Rational[src]

type Output = Rational

The resulting type after applying the * operator.

impl Mul<i16> for Rational[src]

type Output = Rational

The resulting type after applying the * operator.

impl Mul<i16> for &Rational[src]

type Output = Rational

The resulting type after applying the * operator.

impl Mul<i32> for Rational[src]

type Output = Rational

The resulting type after applying the * operator.

impl Mul<i32> for &Rational[src]

type Output = Rational

The resulting type after applying the * operator.

impl Mul<i64> for Rational[src]

type Output = Rational

The resulting type after applying the * operator.

impl Mul<i64> for &Rational[src]

type Output = Rational

The resulting type after applying the * operator.

impl Mul<i8> for Rational[src]

type Output = Rational

The resulting type after applying the * operator.

impl Mul<i8> for &Rational[src]

type Output = Rational

The resulting type after applying the * operator.

impl Mul<u128> for Rational[src]

type Output = Rational

The resulting type after applying the * operator.

impl Mul<u128> for &Rational[src]

type Output = Rational

The resulting type after applying the * operator.

impl Mul<u16> for Rational[src]

type Output = Rational

The resulting type after applying the * operator.

impl Mul<u16> for &Rational[src]

type Output = Rational

The resulting type after applying the * operator.

impl Mul<u32> for Rational[src]

type Output = Rational

The resulting type after applying the * operator.

impl Mul<u32> for &Rational[src]

type Output = Rational

The resulting type after applying the * operator.

impl Mul<u64> for Rational[src]

type Output = Rational

The resulting type after applying the * operator.

impl Mul<u64> for &Rational[src]

type Output = Rational

The resulting type after applying the * operator.

impl Mul<u8> for Rational[src]

type Output = Rational

The resulting type after applying the * operator.

impl Mul<u8> for &Rational[src]

type Output = Rational

The resulting type after applying the * operator.

impl MulAssign<&'_ Integer> for Rational[src]

impl MulAssign<&'_ Rational> for Rational[src]

impl MulAssign<&'_ i128> for Rational[src]

impl MulAssign<&'_ i16> for Rational[src]

impl MulAssign<&'_ i32> for Rational[src]

impl MulAssign<&'_ i64> for Rational[src]

impl MulAssign<&'_ i8> for Rational[src]

impl MulAssign<&'_ u128> for Rational[src]

impl MulAssign<&'_ u16> for Rational[src]

impl MulAssign<&'_ u32> for Rational[src]

impl MulAssign<&'_ u64> for Rational[src]

impl MulAssign<&'_ u8> for Rational[src]

impl MulAssign<Integer> for Rational[src]

impl MulAssign<Rational> for Rational[src]

impl MulAssign<i128> for Rational[src]

impl MulAssign<i16> for Rational[src]

impl MulAssign<i32> for Rational[src]

impl MulAssign<i64> for Rational[src]

impl MulAssign<i8> for Rational[src]

impl MulAssign<u128> for Rational[src]

impl MulAssign<u16> for Rational[src]

impl MulAssign<u32> for Rational[src]

impl MulAssign<u64> for Rational[src]

impl MulAssign<u8> for Rational[src]

impl Neg for Rational[src]

type Output = Rational

The resulting type after applying the - operator.

impl Neg for &Rational[src]

type Output = Rational

The resulting type after applying the - operator.

impl Ord for Rational[src]

impl PartialEq<(Integer, Integer)> for Rational[src]

impl PartialEq<(i128, i128)> for Rational[src]

impl PartialEq<(i16, i16)> for Rational[src]

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

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

impl PartialEq<(i8, i8)> for Rational[src]

impl PartialEq<(u128, u128)> for Rational[src]

impl PartialEq<(u16, u16)> for Rational[src]

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

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

impl PartialEq<(u8, u8)> for Rational[src]

impl PartialEq<Integer> for Rational[src]

impl PartialEq<Rational> for Rational[src]

impl PartialEq<Rational> for Integer[src]

impl PartialEq<i128> for Rational[src]

impl PartialEq<i16> for Rational[src]

impl PartialEq<i32> for Rational[src]

impl PartialEq<i64> for Rational[src]

impl PartialEq<i8> for Rational[src]

impl PartialEq<u128> for Rational[src]

impl PartialEq<u16> for Rational[src]

impl PartialEq<u32> for Rational[src]

impl PartialEq<u64> for Rational[src]

impl PartialEq<u8> for Rational[src]

impl PartialOrd<(Integer, Integer)> for Rational[src]

impl PartialOrd<(i128, i128)> for Rational[src]

impl PartialOrd<(i16, i16)> for Rational[src]

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

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

impl PartialOrd<(i8, i8)> for Rational[src]

impl PartialOrd<(u128, u128)> for Rational[src]

impl PartialOrd<(u16, u16)> for Rational[src]

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

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

impl PartialOrd<(u8, u8)> for Rational[src]

impl PartialOrd<Integer> for Rational[src]

impl PartialOrd<Rational> for Rational[src]

impl PartialOrd<Rational> for Integer[src]

impl PartialOrd<i128> for Rational[src]

impl PartialOrd<i16> for Rational[src]

impl PartialOrd<i32> for Rational[src]

impl PartialOrd<i64> for Rational[src]

impl PartialOrd<i8> for Rational[src]

impl PartialOrd<u128> for Rational[src]

impl PartialOrd<u16> for Rational[src]

impl PartialOrd<u32> for Rational[src]

impl PartialOrd<u64> for Rational[src]

impl PartialOrd<u8> for Rational[src]

impl Product<Rational> for Rational[src]

impl Send for Rational[src]

impl Sub<&'_ Integer> for Rational[src]

type Output = Rational

The resulting type after applying the - operator.

impl Sub<&'_ Integer> for &Rational[src]

type Output = Rational

The resulting type after applying the - operator.

impl Sub<&'_ Rational> for Rational[src]

type Output = Rational

The resulting type after applying the - operator.

impl Sub<&'_ Rational> for &Rational[src]

type Output = Rational

The resulting type after applying the - operator.

impl Sub<&'_ Rational> for Integer[src]

type Output = Rational

The resulting type after applying the - operator.

impl Sub<&'_ Rational> for &Integer[src]

type Output = Rational

The resulting type after applying the - operator.

impl Sub<&'_ i128> for Rational[src]

type Output = Rational

The resulting type after applying the - operator.

impl Sub<&'_ i128> for &Rational[src]

type Output = Rational

The resulting type after applying the - operator.

impl Sub<&'_ i16> for Rational[src]

type Output = Rational

The resulting type after applying the - operator.

impl Sub<&'_ i16> for &Rational[src]

type Output = Rational

The resulting type after applying the - operator.

impl Sub<&'_ i32> for Rational[src]

type Output = Rational

The resulting type after applying the - operator.

impl Sub<&'_ i32> for &Rational[src]

type Output = Rational

The resulting type after applying the - operator.

impl Sub<&'_ i64> for Rational[src]

type Output = Rational

The resulting type after applying the - operator.

impl Sub<&'_ i64> for &Rational[src]

type Output = Rational

The resulting type after applying the - operator.

impl Sub<&'_ i8> for Rational[src]

type Output = Rational

The resulting type after applying the - operator.

impl Sub<&'_ i8> for &Rational[src]

type Output = Rational

The resulting type after applying the - operator.

impl Sub<&'_ u128> for Rational[src]

type Output = Rational

The resulting type after applying the - operator.

impl Sub<&'_ u128> for &Rational[src]

type Output = Rational

The resulting type after applying the - operator.

impl Sub<&'_ u16> for Rational[src]

type Output = Rational

The resulting type after applying the - operator.

impl Sub<&'_ u16> for &Rational[src]

type Output = Rational

The resulting type after applying the - operator.

impl Sub<&'_ u32> for Rational[src]

type Output = Rational

The resulting type after applying the - operator.

impl Sub<&'_ u32> for &Rational[src]

type Output = Rational

The resulting type after applying the - operator.

impl Sub<&'_ u64> for Rational[src]

type Output = Rational

The resulting type after applying the - operator.

impl Sub<&'_ u64> for &Rational[src]

type Output = Rational

The resulting type after applying the - operator.

impl Sub<&'_ u8> for Rational[src]

type Output = Rational

The resulting type after applying the - operator.

impl Sub<&'_ u8> for &Rational[src]

type Output = Rational

The resulting type after applying the - operator.

impl Sub<Integer> for Rational[src]

type Output = Rational

The resulting type after applying the - operator.

impl Sub<Integer> for &Rational[src]

type Output = Rational

The resulting type after applying the - operator.

impl Sub<Rational> for Rational[src]

type Output = Rational

The resulting type after applying the - operator.

impl Sub<Rational> for &Rational[src]

type Output = Rational

The resulting type after applying the - operator.

impl Sub<Rational> for Integer[src]

type Output = Rational

The resulting type after applying the - operator.

impl Sub<Rational> for &Integer[src]

type Output = Rational

The resulting type after applying the - operator.

impl Sub<i128> for Rational[src]

type Output = Rational

The resulting type after applying the - operator.

impl Sub<i128> for &Rational[src]

type Output = Rational

The resulting type after applying the - operator.

impl Sub<i16> for Rational[src]

type Output = Rational

The resulting type after applying the - operator.

impl Sub<i16> for &Rational[src]

type Output = Rational

The resulting type after applying the - operator.

impl Sub<i32> for Rational[src]

type Output = Rational

The resulting type after applying the - operator.

impl Sub<i32> for &Rational[src]

type Output = Rational

The resulting type after applying the - operator.

impl Sub<i64> for Rational[src]

type Output = Rational

The resulting type after applying the - operator.

impl Sub<i64> for &Rational[src]

type Output = Rational

The resulting type after applying the - operator.

impl Sub<i8> for Rational[src]

type Output = Rational

The resulting type after applying the - operator.

impl Sub<i8> for &Rational[src]

type Output = Rational

The resulting type after applying the - operator.

impl Sub<u128> for Rational[src]

type Output = Rational

The resulting type after applying the - operator.

impl Sub<u128> for &Rational[src]

type Output = Rational

The resulting type after applying the - operator.

impl Sub<u16> for Rational[src]

type Output = Rational

The resulting type after applying the - operator.

impl Sub<u16> for &Rational[src]

type Output = Rational

The resulting type after applying the - operator.

impl Sub<u32> for Rational[src]

type Output = Rational

The resulting type after applying the - operator.

impl Sub<u32> for &Rational[src]

type Output = Rational

The resulting type after applying the - operator.

impl Sub<u64> for Rational[src]

type Output = Rational

The resulting type after applying the - operator.

impl Sub<u64> for &Rational[src]

type Output = Rational

The resulting type after applying the - operator.

impl Sub<u8> for Rational[src]

type Output = Rational

The resulting type after applying the - operator.

impl Sub<u8> for &Rational[src]

type Output = Rational

The resulting type after applying the - operator.

impl SubAssign<&'_ Integer> for Rational[src]

impl SubAssign<&'_ Rational> for Rational[src]

impl SubAssign<&'_ i128> for Rational[src]

impl SubAssign<&'_ i16> for Rational[src]

impl SubAssign<&'_ i32> for Rational[src]

impl SubAssign<&'_ i64> for Rational[src]

impl SubAssign<&'_ i8> for Rational[src]

impl SubAssign<&'_ u128> for Rational[src]

impl SubAssign<&'_ u16> for Rational[src]

impl SubAssign<&'_ u32> for Rational[src]

impl SubAssign<&'_ u64> for Rational[src]

impl SubAssign<&'_ u8> for Rational[src]

impl SubAssign<Integer> for Rational[src]

impl SubAssign<Rational> for Rational[src]

impl SubAssign<i128> for Rational[src]

impl SubAssign<i16> for Rational[src]

impl SubAssign<i32> for Rational[src]

impl SubAssign<i64> for Rational[src]

impl SubAssign<i8> for Rational[src]

impl SubAssign<u128> for Rational[src]

impl SubAssign<u16> for Rational[src]

impl SubAssign<u32> for Rational[src]

impl SubAssign<u64> for Rational[src]

impl SubAssign<u8> for Rational[src]

impl Sum<Rational> for Rational[src]

impl TryFrom<&'_ Rational> for Integer[src]

type Error = Error

The type returned in the event of a conversion error.

impl TryFrom<Rational> for Integer[src]

type Error = Error

The type returned in the event of a conversion error.

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.