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.
fn add(self, rhs: &Integer) -> Self::Output
[src]
impl Add<&'_ Integer> for &Rational
[src]
type Output = Rational
The resulting type after applying the +
operator.
fn add(self, rhs: &Integer) -> Self::Output
[src]
impl Add<&'_ Rational> for Rational
[src]
type Output = Rational
The resulting type after applying the +
operator.
fn add(self, rhs: &Rational) -> Self::Output
[src]
impl Add<&'_ Rational> for &Rational
[src]
type Output = Rational
The resulting type after applying the +
operator.
fn add(self, rhs: &Rational) -> Self::Output
[src]
impl Add<&'_ Rational> for Integer
[src]
type Output = Rational
The resulting type after applying the +
operator.
fn add(self, rhs: &Rational) -> Self::Output
[src]
impl Add<&'_ Rational> for &Integer
[src]
type Output = Rational
The resulting type after applying the +
operator.
fn add(self, rhs: &Rational) -> Self::Output
[src]
impl Add<&'_ i128> for Rational
[src]
type Output = Rational
The resulting type after applying the +
operator.
fn add(self, rhs: &i128) -> Self::Output
[src]
impl Add<&'_ i128> for &Rational
[src]
type Output = Rational
The resulting type after applying the +
operator.
fn add(self, rhs: &i128) -> Self::Output
[src]
impl Add<&'_ i16> for Rational
[src]
type Output = Rational
The resulting type after applying the +
operator.
fn add(self, rhs: &i16) -> Self::Output
[src]
impl Add<&'_ i16> for &Rational
[src]
type Output = Rational
The resulting type after applying the +
operator.
fn add(self, rhs: &i16) -> Self::Output
[src]
impl Add<&'_ i32> for Rational
[src]
type Output = Rational
The resulting type after applying the +
operator.
fn add(self, rhs: &i32) -> Self::Output
[src]
impl Add<&'_ i32> for &Rational
[src]
type Output = Rational
The resulting type after applying the +
operator.
fn add(self, rhs: &i32) -> Self::Output
[src]
impl Add<&'_ i64> for Rational
[src]
type Output = Rational
The resulting type after applying the +
operator.
fn add(self, rhs: &i64) -> Self::Output
[src]
impl Add<&'_ i64> for &Rational
[src]
type Output = Rational
The resulting type after applying the +
operator.
fn add(self, rhs: &i64) -> Self::Output
[src]
impl Add<&'_ i8> for Rational
[src]
type Output = Rational
The resulting type after applying the +
operator.
fn add(self, rhs: &i8) -> Self::Output
[src]
impl Add<&'_ i8> for &Rational
[src]
type Output = Rational
The resulting type after applying the +
operator.
fn add(self, rhs: &i8) -> Self::Output
[src]
impl Add<&'_ u128> for Rational
[src]
type Output = Rational
The resulting type after applying the +
operator.
fn add(self, rhs: &u128) -> Self::Output
[src]
impl Add<&'_ u128> for &Rational
[src]
type Output = Rational
The resulting type after applying the +
operator.
fn add(self, rhs: &u128) -> Self::Output
[src]
impl Add<&'_ u16> for Rational
[src]
type Output = Rational
The resulting type after applying the +
operator.
fn add(self, rhs: &u16) -> Self::Output
[src]
impl Add<&'_ u16> for &Rational
[src]
type Output = Rational
The resulting type after applying the +
operator.
fn add(self, rhs: &u16) -> Self::Output
[src]
impl Add<&'_ u32> for Rational
[src]
type Output = Rational
The resulting type after applying the +
operator.
fn add(self, rhs: &u32) -> Self::Output
[src]
impl Add<&'_ u32> for &Rational
[src]
type Output = Rational
The resulting type after applying the +
operator.
fn add(self, rhs: &u32) -> Self::Output
[src]
impl Add<&'_ u64> for Rational
[src]
type Output = Rational
The resulting type after applying the +
operator.
fn add(self, rhs: &u64) -> Self::Output
[src]
impl Add<&'_ u64> for &Rational
[src]
type Output = Rational
The resulting type after applying the +
operator.
fn add(self, rhs: &u64) -> Self::Output
[src]
impl Add<&'_ u8> for Rational
[src]
type Output = Rational
The resulting type after applying the +
operator.
fn add(self, rhs: &u8) -> Self::Output
[src]
impl Add<&'_ u8> for &Rational
[src]
type Output = Rational
The resulting type after applying the +
operator.
fn add(self, rhs: &u8) -> Self::Output
[src]
impl Add<Integer> for Rational
[src]
type Output = Rational
The resulting type after applying the +
operator.
fn add(self, rhs: Integer) -> Self::Output
[src]
impl Add<Integer> for &Rational
[src]
type Output = Rational
The resulting type after applying the +
operator.
fn add(self, rhs: Integer) -> Self::Output
[src]
impl Add<Rational> for Rational
[src]
type Output = Rational
The resulting type after applying the +
operator.
fn add(self, rhs: Rational) -> Self::Output
[src]
impl Add<Rational> for &Rational
[src]
type Output = Rational
The resulting type after applying the +
operator.
fn add(self, rhs: Rational) -> Self::Output
[src]
impl Add<Rational> for Integer
[src]
type Output = Rational
The resulting type after applying the +
operator.
fn add(self, rhs: Rational) -> Self::Output
[src]
impl Add<Rational> for &Integer
[src]
type Output = Rational
The resulting type after applying the +
operator.
fn add(self, rhs: Rational) -> Self::Output
[src]
impl Add<i128> for Rational
[src]
type Output = Rational
The resulting type after applying the +
operator.
fn add(self, rhs: i128) -> Self::Output
[src]
impl Add<i128> for &Rational
[src]
type Output = Rational
The resulting type after applying the +
operator.
fn add(self, rhs: i128) -> Self::Output
[src]
impl Add<i16> for Rational
[src]
type Output = Rational
The resulting type after applying the +
operator.
fn add(self, rhs: i16) -> Self::Output
[src]
impl Add<i16> for &Rational
[src]
type Output = Rational
The resulting type after applying the +
operator.
fn add(self, rhs: i16) -> Self::Output
[src]
impl Add<i32> for Rational
[src]
type Output = Rational
The resulting type after applying the +
operator.
fn add(self, rhs: i32) -> Self::Output
[src]
impl Add<i32> for &Rational
[src]
type Output = Rational
The resulting type after applying the +
operator.
fn add(self, rhs: i32) -> Self::Output
[src]
impl Add<i64> for Rational
[src]
type Output = Rational
The resulting type after applying the +
operator.
fn add(self, rhs: i64) -> Self::Output
[src]
impl Add<i64> for &Rational
[src]
type Output = Rational
The resulting type after applying the +
operator.
fn add(self, rhs: i64) -> Self::Output
[src]
impl Add<i8> for Rational
[src]
type Output = Rational
The resulting type after applying the +
operator.
fn add(self, rhs: i8) -> Self::Output
[src]
impl Add<i8> for &Rational
[src]
type Output = Rational
The resulting type after applying the +
operator.
fn add(self, rhs: i8) -> Self::Output
[src]
impl Add<u128> for Rational
[src]
type Output = Rational
The resulting type after applying the +
operator.
fn add(self, rhs: u128) -> Self::Output
[src]
impl Add<u128> for &Rational
[src]
type Output = Rational
The resulting type after applying the +
operator.
fn add(self, rhs: u128) -> Self::Output
[src]
impl Add<u16> for Rational
[src]
type Output = Rational
The resulting type after applying the +
operator.
fn add(self, rhs: u16) -> Self::Output
[src]
impl Add<u16> for &Rational
[src]
type Output = Rational
The resulting type after applying the +
operator.
fn add(self, rhs: u16) -> Self::Output
[src]
impl Add<u32> for Rational
[src]
type Output = Rational
The resulting type after applying the +
operator.
fn add(self, rhs: u32) -> Self::Output
[src]
impl Add<u32> for &Rational
[src]
type Output = Rational
The resulting type after applying the +
operator.
fn add(self, rhs: u32) -> Self::Output
[src]
impl Add<u64> for Rational
[src]
type Output = Rational
The resulting type after applying the +
operator.
fn add(self, rhs: u64) -> Self::Output
[src]
impl Add<u64> for &Rational
[src]
type Output = Rational
The resulting type after applying the +
operator.
fn add(self, rhs: u64) -> Self::Output
[src]
impl Add<u8> for Rational
[src]
type Output = Rational
The resulting type after applying the +
operator.
fn add(self, rhs: u8) -> Self::Output
[src]
impl Add<u8> for &Rational
[src]
type Output = Rational
The resulting type after applying the +
operator.
fn add(self, rhs: u8) -> Self::Output
[src]
impl AddAssign<&'_ Integer> for Rational
[src]
fn add_assign(&mut self, rhs: &Integer)
[src]
impl AddAssign<&'_ Rational> for Rational
[src]
fn add_assign(&mut self, rhs: &Rational)
[src]
impl AddAssign<&'_ i128> for Rational
[src]
fn add_assign(&mut self, rhs: &i128)
[src]
impl AddAssign<&'_ i16> for Rational
[src]
fn add_assign(&mut self, rhs: &i16)
[src]
impl AddAssign<&'_ i32> for Rational
[src]
fn add_assign(&mut self, rhs: &i32)
[src]
impl AddAssign<&'_ i64> for Rational
[src]
fn add_assign(&mut self, rhs: &i64)
[src]
impl AddAssign<&'_ i8> for Rational
[src]
fn add_assign(&mut self, rhs: &i8)
[src]
impl AddAssign<&'_ u128> for Rational
[src]
fn add_assign(&mut self, rhs: &u128)
[src]
impl AddAssign<&'_ u16> for Rational
[src]
fn add_assign(&mut self, rhs: &u16)
[src]
impl AddAssign<&'_ u32> for Rational
[src]
fn add_assign(&mut self, rhs: &u32)
[src]
impl AddAssign<&'_ u64> for Rational
[src]
fn add_assign(&mut self, rhs: &u64)
[src]
impl AddAssign<&'_ u8> for Rational
[src]
fn add_assign(&mut self, rhs: &u8)
[src]
impl AddAssign<Integer> for Rational
[src]
fn add_assign(&mut self, rhs: Integer)
[src]
impl AddAssign<Rational> for Rational
[src]
fn add_assign(&mut self, rhs: Rational)
[src]
impl AddAssign<i128> for Rational
[src]
fn add_assign(&mut self, rhs: i128)
[src]
impl AddAssign<i16> for Rational
[src]
fn add_assign(&mut self, rhs: i16)
[src]
impl AddAssign<i32> for Rational
[src]
fn add_assign(&mut self, rhs: i32)
[src]
impl AddAssign<i64> for Rational
[src]
fn add_assign(&mut self, rhs: i64)
[src]
impl AddAssign<i8> for Rational
[src]
fn add_assign(&mut self, rhs: i8)
[src]
impl AddAssign<u128> for Rational
[src]
fn add_assign(&mut self, rhs: u128)
[src]
impl AddAssign<u16> for Rational
[src]
fn add_assign(&mut self, rhs: u16)
[src]
impl AddAssign<u32> for Rational
[src]
fn add_assign(&mut self, rhs: u32)
[src]
impl AddAssign<u64> for Rational
[src]
fn add_assign(&mut self, rhs: u64)
[src]
impl AddAssign<u8> for Rational
[src]
fn add_assign(&mut self, rhs: u8)
[src]
impl Clone for Rational
[src]
fn clone(&self) -> Self
[src]
fn clone_from(&mut self, source: &Self)
[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.
fn div(self, rhs: &Integer) -> Self::Output
[src]
impl Div<&'_ Integer> for &Rational
[src]
type Output = Rational
The resulting type after applying the /
operator.
fn div(self, rhs: &Integer) -> Self::Output
[src]
impl Div<&'_ Rational> for Rational
[src]
type Output = Rational
The resulting type after applying the /
operator.
fn div(self, rhs: &Rational) -> Self::Output
[src]
impl Div<&'_ Rational> for &Rational
[src]
type Output = Rational
The resulting type after applying the /
operator.
fn div(self, rhs: &Rational) -> Self::Output
[src]
impl Div<&'_ Rational> for Integer
[src]
type Output = Rational
The resulting type after applying the /
operator.
fn div(self, rhs: &Rational) -> Self::Output
[src]
impl Div<&'_ Rational> for &Integer
[src]
type Output = Rational
The resulting type after applying the /
operator.
fn div(self, rhs: &Rational) -> Self::Output
[src]
impl Div<&'_ i128> for Rational
[src]
type Output = Rational
The resulting type after applying the /
operator.
fn div(self, rhs: &i128) -> Self::Output
[src]
impl Div<&'_ i128> for &Rational
[src]
type Output = Rational
The resulting type after applying the /
operator.
fn div(self, rhs: &i128) -> Self::Output
[src]
impl Div<&'_ i16> for Rational
[src]
type Output = Rational
The resulting type after applying the /
operator.
fn div(self, rhs: &i16) -> Self::Output
[src]
impl Div<&'_ i16> for &Rational
[src]
type Output = Rational
The resulting type after applying the /
operator.
fn div(self, rhs: &i16) -> Self::Output
[src]
impl Div<&'_ i32> for Rational
[src]
type Output = Rational
The resulting type after applying the /
operator.
fn div(self, rhs: &i32) -> Self::Output
[src]
impl Div<&'_ i32> for &Rational
[src]
type Output = Rational
The resulting type after applying the /
operator.
fn div(self, rhs: &i32) -> Self::Output
[src]
impl Div<&'_ i64> for Rational
[src]
type Output = Rational
The resulting type after applying the /
operator.
fn div(self, rhs: &i64) -> Self::Output
[src]
impl Div<&'_ i64> for &Rational
[src]
type Output = Rational
The resulting type after applying the /
operator.
fn div(self, rhs: &i64) -> Self::Output
[src]
impl Div<&'_ i8> for Rational
[src]
type Output = Rational
The resulting type after applying the /
operator.
fn div(self, rhs: &i8) -> Self::Output
[src]
impl Div<&'_ i8> for &Rational
[src]
type Output = Rational
The resulting type after applying the /
operator.
fn div(self, rhs: &i8) -> Self::Output
[src]
impl Div<&'_ u128> for Rational
[src]
type Output = Rational
The resulting type after applying the /
operator.
fn div(self, rhs: &u128) -> Self::Output
[src]
impl Div<&'_ u128> for &Rational
[src]
type Output = Rational
The resulting type after applying the /
operator.
fn div(self, rhs: &u128) -> Self::Output
[src]
impl Div<&'_ u16> for Rational
[src]
type Output = Rational
The resulting type after applying the /
operator.
fn div(self, rhs: &u16) -> Self::Output
[src]
impl Div<&'_ u16> for &Rational
[src]
type Output = Rational
The resulting type after applying the /
operator.
fn div(self, rhs: &u16) -> Self::Output
[src]
impl Div<&'_ u32> for Rational
[src]
type Output = Rational
The resulting type after applying the /
operator.
fn div(self, rhs: &u32) -> Self::Output
[src]
impl Div<&'_ u32> for &Rational
[src]
type Output = Rational
The resulting type after applying the /
operator.
fn div(self, rhs: &u32) -> Self::Output
[src]
impl Div<&'_ u64> for Rational
[src]
type Output = Rational
The resulting type after applying the /
operator.
fn div(self, rhs: &u64) -> Self::Output
[src]
impl Div<&'_ u64> for &Rational
[src]
type Output = Rational
The resulting type after applying the /
operator.
fn div(self, rhs: &u64) -> Self::Output
[src]
impl Div<&'_ u8> for Rational
[src]
type Output = Rational
The resulting type after applying the /
operator.
fn div(self, rhs: &u8) -> Self::Output
[src]
impl Div<&'_ u8> for &Rational
[src]
type Output = Rational
The resulting type after applying the /
operator.
fn div(self, rhs: &u8) -> Self::Output
[src]
impl Div<Integer> for Rational
[src]
type Output = Rational
The resulting type after applying the /
operator.
fn div(self, rhs: Integer) -> Self::Output
[src]
impl Div<Integer> for &Rational
[src]
type Output = Rational
The resulting type after applying the /
operator.
fn div(self, rhs: Integer) -> Self::Output
[src]
impl Div<Rational> for Rational
[src]
type Output = Rational
The resulting type after applying the /
operator.
fn div(self, rhs: Rational) -> Self::Output
[src]
impl Div<Rational> for &Rational
[src]
type Output = Rational
The resulting type after applying the /
operator.
fn div(self, rhs: Rational) -> Self::Output
[src]
impl Div<Rational> for Integer
[src]
type Output = Rational
The resulting type after applying the /
operator.
fn div(self, rhs: Rational) -> Self::Output
[src]
impl Div<Rational> for &Integer
[src]
type Output = Rational
The resulting type after applying the /
operator.
fn div(self, rhs: Rational) -> Self::Output
[src]
impl Div<i128> for Rational
[src]
type Output = Rational
The resulting type after applying the /
operator.
fn div(self, rhs: i128) -> Self::Output
[src]
impl Div<i128> for &Rational
[src]
type Output = Rational
The resulting type after applying the /
operator.
fn div(self, rhs: i128) -> Self::Output
[src]
impl Div<i16> for Rational
[src]
type Output = Rational
The resulting type after applying the /
operator.
fn div(self, rhs: i16) -> Self::Output
[src]
impl Div<i16> for &Rational
[src]
type Output = Rational
The resulting type after applying the /
operator.
fn div(self, rhs: i16) -> Self::Output
[src]
impl Div<i32> for Rational
[src]
type Output = Rational
The resulting type after applying the /
operator.
fn div(self, rhs: i32) -> Self::Output
[src]
impl Div<i32> for &Rational
[src]
type Output = Rational
The resulting type after applying the /
operator.
fn div(self, rhs: i32) -> Self::Output
[src]
impl Div<i64> for Rational
[src]
type Output = Rational
The resulting type after applying the /
operator.
fn div(self, rhs: i64) -> Self::Output
[src]
impl Div<i64> for &Rational
[src]
type Output = Rational
The resulting type after applying the /
operator.
fn div(self, rhs: i64) -> Self::Output
[src]
impl Div<i8> for Rational
[src]
type Output = Rational
The resulting type after applying the /
operator.
fn div(self, rhs: i8) -> Self::Output
[src]
impl Div<i8> for &Rational
[src]
type Output = Rational
The resulting type after applying the /
operator.
fn div(self, rhs: i8) -> Self::Output
[src]
impl Div<u128> for Rational
[src]
type Output = Rational
The resulting type after applying the /
operator.
fn div(self, rhs: u128) -> Self::Output
[src]
impl Div<u128> for &Rational
[src]
type Output = Rational
The resulting type after applying the /
operator.
fn div(self, rhs: u128) -> Self::Output
[src]
impl Div<u16> for Rational
[src]
type Output = Rational
The resulting type after applying the /
operator.
fn div(self, rhs: u16) -> Self::Output
[src]
impl Div<u16> for &Rational
[src]
type Output = Rational
The resulting type after applying the /
operator.
fn div(self, rhs: u16) -> Self::Output
[src]
impl Div<u32> for Rational
[src]
type Output = Rational
The resulting type after applying the /
operator.
fn div(self, rhs: u32) -> Self::Output
[src]
impl Div<u32> for &Rational
[src]
type Output = Rational
The resulting type after applying the /
operator.
fn div(self, rhs: u32) -> Self::Output
[src]
impl Div<u64> for Rational
[src]
type Output = Rational
The resulting type after applying the /
operator.
fn div(self, rhs: u64) -> Self::Output
[src]
impl Div<u64> for &Rational
[src]
type Output = Rational
The resulting type after applying the /
operator.
fn div(self, rhs: u64) -> Self::Output
[src]
impl Div<u8> for Rational
[src]
type Output = Rational
The resulting type after applying the /
operator.
fn div(self, rhs: u8) -> Self::Output
[src]
impl Div<u8> for &Rational
[src]
type Output = Rational
The resulting type after applying the /
operator.
fn div(self, rhs: u8) -> Self::Output
[src]
impl DivAssign<&'_ Integer> for Rational
[src]
fn div_assign(&mut self, rhs: &Integer)
[src]
impl DivAssign<&'_ Rational> for Rational
[src]
fn div_assign(&mut self, rhs: &Rational)
[src]
impl DivAssign<&'_ i128> for Rational
[src]
fn div_assign(&mut self, rhs: &i128)
[src]
impl DivAssign<&'_ i16> for Rational
[src]
fn div_assign(&mut self, rhs: &i16)
[src]
impl DivAssign<&'_ i32> for Rational
[src]
fn div_assign(&mut self, rhs: &i32)
[src]
impl DivAssign<&'_ i64> for Rational
[src]
fn div_assign(&mut self, rhs: &i64)
[src]
impl DivAssign<&'_ i8> for Rational
[src]
fn div_assign(&mut self, rhs: &i8)
[src]
impl DivAssign<&'_ u128> for Rational
[src]
fn div_assign(&mut self, rhs: &u128)
[src]
impl DivAssign<&'_ u16> for Rational
[src]
fn div_assign(&mut self, rhs: &u16)
[src]
impl DivAssign<&'_ u32> for Rational
[src]
fn div_assign(&mut self, rhs: &u32)
[src]
impl DivAssign<&'_ u64> for Rational
[src]
fn div_assign(&mut self, rhs: &u64)
[src]
impl DivAssign<&'_ u8> for Rational
[src]
fn div_assign(&mut self, rhs: &u8)
[src]
impl DivAssign<Integer> for Rational
[src]
fn div_assign(&mut self, rhs: Integer)
[src]
impl DivAssign<Rational> for Rational
[src]
fn div_assign(&mut self, rhs: Rational)
[src]
impl DivAssign<i128> for Rational
[src]
fn div_assign(&mut self, rhs: i128)
[src]
impl DivAssign<i16> for Rational
[src]
fn div_assign(&mut self, rhs: i16)
[src]
impl DivAssign<i32> for Rational
[src]
fn div_assign(&mut self, rhs: i32)
[src]
impl DivAssign<i64> for Rational
[src]
fn div_assign(&mut self, rhs: i64)
[src]
impl DivAssign<i8> for Rational
[src]
fn div_assign(&mut self, rhs: i8)
[src]
impl DivAssign<u128> for Rational
[src]
fn div_assign(&mut self, rhs: u128)
[src]
impl DivAssign<u16> for Rational
[src]
fn div_assign(&mut self, rhs: u16)
[src]
impl DivAssign<u32> for Rational
[src]
fn div_assign(&mut self, rhs: u32)
[src]
impl DivAssign<u64> for Rational
[src]
fn div_assign(&mut self, rhs: u64)
[src]
impl DivAssign<u8> for Rational
[src]
fn div_assign(&mut self, rhs: u8)
[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]
&'a A: Into<Integer>,
&'a B: Into<Integer>,
impl<A, B> From<(A, B)> for Rational where
A: Into<Integer>,
B: Into<Integer>,
[src]
A: Into<Integer>,
B: Into<Integer>,
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.
fn from_str(s: &str) -> Result<Self, Error>
[src]
impl Mul<&'_ Integer> for Rational
[src]
type Output = Rational
The resulting type after applying the *
operator.
fn mul(self, rhs: &Integer) -> Self::Output
[src]
impl Mul<&'_ Integer> for &Rational
[src]
type Output = Rational
The resulting type after applying the *
operator.
fn mul(self, rhs: &Integer) -> Self::Output
[src]
impl Mul<&'_ Rational> for Rational
[src]
type Output = Rational
The resulting type after applying the *
operator.
fn mul(self, rhs: &Rational) -> Self::Output
[src]
impl Mul<&'_ Rational> for &Rational
[src]
type Output = Rational
The resulting type after applying the *
operator.
fn mul(self, rhs: &Rational) -> Self::Output
[src]
impl Mul<&'_ Rational> for Integer
[src]
type Output = Rational
The resulting type after applying the *
operator.
fn mul(self, rhs: &Rational) -> Self::Output
[src]
impl Mul<&'_ Rational> for &Integer
[src]
type Output = Rational
The resulting type after applying the *
operator.
fn mul(self, rhs: &Rational) -> Self::Output
[src]
impl Mul<&'_ i128> for Rational
[src]
type Output = Rational
The resulting type after applying the *
operator.
fn mul(self, rhs: &i128) -> Self::Output
[src]
impl Mul<&'_ i128> for &Rational
[src]
type Output = Rational
The resulting type after applying the *
operator.
fn mul(self, rhs: &i128) -> Self::Output
[src]
impl Mul<&'_ i16> for Rational
[src]
type Output = Rational
The resulting type after applying the *
operator.
fn mul(self, rhs: &i16) -> Self::Output
[src]
impl Mul<&'_ i16> for &Rational
[src]
type Output = Rational
The resulting type after applying the *
operator.
fn mul(self, rhs: &i16) -> Self::Output
[src]
impl Mul<&'_ i32> for Rational
[src]
type Output = Rational
The resulting type after applying the *
operator.
fn mul(self, rhs: &i32) -> Self::Output
[src]
impl Mul<&'_ i32> for &Rational
[src]
type Output = Rational
The resulting type after applying the *
operator.
fn mul(self, rhs: &i32) -> Self::Output
[src]
impl Mul<&'_ i64> for Rational
[src]
type Output = Rational
The resulting type after applying the *
operator.
fn mul(self, rhs: &i64) -> Self::Output
[src]
impl Mul<&'_ i64> for &Rational
[src]
type Output = Rational
The resulting type after applying the *
operator.
fn mul(self, rhs: &i64) -> Self::Output
[src]
impl Mul<&'_ i8> for Rational
[src]
type Output = Rational
The resulting type after applying the *
operator.
fn mul(self, rhs: &i8) -> Self::Output
[src]
impl Mul<&'_ i8> for &Rational
[src]
type Output = Rational
The resulting type after applying the *
operator.
fn mul(self, rhs: &i8) -> Self::Output
[src]
impl Mul<&'_ u128> for Rational
[src]
type Output = Rational
The resulting type after applying the *
operator.
fn mul(self, rhs: &u128) -> Self::Output
[src]
impl Mul<&'_ u128> for &Rational
[src]
type Output = Rational
The resulting type after applying the *
operator.
fn mul(self, rhs: &u128) -> Self::Output
[src]
impl Mul<&'_ u16> for Rational
[src]
type Output = Rational
The resulting type after applying the *
operator.
fn mul(self, rhs: &u16) -> Self::Output
[src]
impl Mul<&'_ u16> for &Rational
[src]
type Output = Rational
The resulting type after applying the *
operator.
fn mul(self, rhs: &u16) -> Self::Output
[src]
impl Mul<&'_ u32> for Rational
[src]
type Output = Rational
The resulting type after applying the *
operator.
fn mul(self, rhs: &u32) -> Self::Output
[src]
impl Mul<&'_ u32> for &Rational
[src]
type Output = Rational
The resulting type after applying the *
operator.
fn mul(self, rhs: &u32) -> Self::Output
[src]
impl Mul<&'_ u64> for Rational
[src]
type Output = Rational
The resulting type after applying the *
operator.
fn mul(self, rhs: &u64) -> Self::Output
[src]
impl Mul<&'_ u64> for &Rational
[src]
type Output = Rational
The resulting type after applying the *
operator.
fn mul(self, rhs: &u64) -> Self::Output
[src]
impl Mul<&'_ u8> for Rational
[src]
type Output = Rational
The resulting type after applying the *
operator.
fn mul(self, rhs: &u8) -> Self::Output
[src]
impl Mul<&'_ u8> for &Rational
[src]
type Output = Rational
The resulting type after applying the *
operator.
fn mul(self, rhs: &u8) -> Self::Output
[src]
impl Mul<Integer> for Rational
[src]
type Output = Rational
The resulting type after applying the *
operator.
fn mul(self, rhs: Integer) -> Self::Output
[src]
impl Mul<Integer> for &Rational
[src]
type Output = Rational
The resulting type after applying the *
operator.
fn mul(self, rhs: Integer) -> Self::Output
[src]
impl Mul<Rational> for Rational
[src]
type Output = Rational
The resulting type after applying the *
operator.
fn mul(self, rhs: Rational) -> Self::Output
[src]
impl Mul<Rational> for &Rational
[src]
type Output = Rational
The resulting type after applying the *
operator.
fn mul(self, rhs: Rational) -> Self::Output
[src]
impl Mul<Rational> for Integer
[src]
type Output = Rational
The resulting type after applying the *
operator.
fn mul(self, rhs: Rational) -> Self::Output
[src]
impl Mul<Rational> for &Integer
[src]
type Output = Rational
The resulting type after applying the *
operator.
fn mul(self, rhs: Rational) -> Self::Output
[src]
impl Mul<i128> for Rational
[src]
type Output = Rational
The resulting type after applying the *
operator.
fn mul(self, rhs: i128) -> Self::Output
[src]
impl Mul<i128> for &Rational
[src]
type Output = Rational
The resulting type after applying the *
operator.
fn mul(self, rhs: i128) -> Self::Output
[src]
impl Mul<i16> for Rational
[src]
type Output = Rational
The resulting type after applying the *
operator.
fn mul(self, rhs: i16) -> Self::Output
[src]
impl Mul<i16> for &Rational
[src]
type Output = Rational
The resulting type after applying the *
operator.
fn mul(self, rhs: i16) -> Self::Output
[src]
impl Mul<i32> for Rational
[src]
type Output = Rational
The resulting type after applying the *
operator.
fn mul(self, rhs: i32) -> Self::Output
[src]
impl Mul<i32> for &Rational
[src]
type Output = Rational
The resulting type after applying the *
operator.
fn mul(self, rhs: i32) -> Self::Output
[src]
impl Mul<i64> for Rational
[src]
type Output = Rational
The resulting type after applying the *
operator.
fn mul(self, rhs: i64) -> Self::Output
[src]
impl Mul<i64> for &Rational
[src]
type Output = Rational
The resulting type after applying the *
operator.
fn mul(self, rhs: i64) -> Self::Output
[src]
impl Mul<i8> for Rational
[src]
type Output = Rational
The resulting type after applying the *
operator.
fn mul(self, rhs: i8) -> Self::Output
[src]
impl Mul<i8> for &Rational
[src]
type Output = Rational
The resulting type after applying the *
operator.
fn mul(self, rhs: i8) -> Self::Output
[src]
impl Mul<u128> for Rational
[src]
type Output = Rational
The resulting type after applying the *
operator.
fn mul(self, rhs: u128) -> Self::Output
[src]
impl Mul<u128> for &Rational
[src]
type Output = Rational
The resulting type after applying the *
operator.
fn mul(self, rhs: u128) -> Self::Output
[src]
impl Mul<u16> for Rational
[src]
type Output = Rational
The resulting type after applying the *
operator.
fn mul(self, rhs: u16) -> Self::Output
[src]
impl Mul<u16> for &Rational
[src]
type Output = Rational
The resulting type after applying the *
operator.
fn mul(self, rhs: u16) -> Self::Output
[src]
impl Mul<u32> for Rational
[src]
type Output = Rational
The resulting type after applying the *
operator.
fn mul(self, rhs: u32) -> Self::Output
[src]
impl Mul<u32> for &Rational
[src]
type Output = Rational
The resulting type after applying the *
operator.
fn mul(self, rhs: u32) -> Self::Output
[src]
impl Mul<u64> for Rational
[src]
type Output = Rational
The resulting type after applying the *
operator.
fn mul(self, rhs: u64) -> Self::Output
[src]
impl Mul<u64> for &Rational
[src]
type Output = Rational
The resulting type after applying the *
operator.
fn mul(self, rhs: u64) -> Self::Output
[src]
impl Mul<u8> for Rational
[src]
type Output = Rational
The resulting type after applying the *
operator.
fn mul(self, rhs: u8) -> Self::Output
[src]
impl Mul<u8> for &Rational
[src]
type Output = Rational
The resulting type after applying the *
operator.
fn mul(self, rhs: u8) -> Self::Output
[src]
impl MulAssign<&'_ Integer> for Rational
[src]
fn mul_assign(&mut self, rhs: &Integer)
[src]
impl MulAssign<&'_ Rational> for Rational
[src]
fn mul_assign(&mut self, rhs: &Rational)
[src]
impl MulAssign<&'_ i128> for Rational
[src]
fn mul_assign(&mut self, rhs: &i128)
[src]
impl MulAssign<&'_ i16> for Rational
[src]
fn mul_assign(&mut self, rhs: &i16)
[src]
impl MulAssign<&'_ i32> for Rational
[src]
fn mul_assign(&mut self, rhs: &i32)
[src]
impl MulAssign<&'_ i64> for Rational
[src]
fn mul_assign(&mut self, rhs: &i64)
[src]
impl MulAssign<&'_ i8> for Rational
[src]
fn mul_assign(&mut self, rhs: &i8)
[src]
impl MulAssign<&'_ u128> for Rational
[src]
fn mul_assign(&mut self, rhs: &u128)
[src]
impl MulAssign<&'_ u16> for Rational
[src]
fn mul_assign(&mut self, rhs: &u16)
[src]
impl MulAssign<&'_ u32> for Rational
[src]
fn mul_assign(&mut self, rhs: &u32)
[src]
impl MulAssign<&'_ u64> for Rational
[src]
fn mul_assign(&mut self, rhs: &u64)
[src]
impl MulAssign<&'_ u8> for Rational
[src]
fn mul_assign(&mut self, rhs: &u8)
[src]
impl MulAssign<Integer> for Rational
[src]
fn mul_assign(&mut self, rhs: Integer)
[src]
impl MulAssign<Rational> for Rational
[src]
fn mul_assign(&mut self, rhs: Rational)
[src]
impl MulAssign<i128> for Rational
[src]
fn mul_assign(&mut self, rhs: i128)
[src]
impl MulAssign<i16> for Rational
[src]
fn mul_assign(&mut self, rhs: i16)
[src]
impl MulAssign<i32> for Rational
[src]
fn mul_assign(&mut self, rhs: i32)
[src]
impl MulAssign<i64> for Rational
[src]
fn mul_assign(&mut self, rhs: i64)
[src]
impl MulAssign<i8> for Rational
[src]
fn mul_assign(&mut self, rhs: i8)
[src]
impl MulAssign<u128> for Rational
[src]
fn mul_assign(&mut self, rhs: u128)
[src]
impl MulAssign<u16> for Rational
[src]
fn mul_assign(&mut self, rhs: u16)
[src]
impl MulAssign<u32> for Rational
[src]
fn mul_assign(&mut self, rhs: u32)
[src]
impl MulAssign<u64> for Rational
[src]
fn mul_assign(&mut self, rhs: u64)
[src]
impl MulAssign<u8> for Rational
[src]
fn mul_assign(&mut self, rhs: u8)
[src]
impl Neg for Rational
[src]
type Output = Rational
The resulting type after applying the -
operator.
fn neg(self) -> Self::Output
[src]
impl Neg for &Rational
[src]
type Output = Rational
The resulting type after applying the -
operator.
fn neg(self) -> Self::Output
[src]
impl Ord for Rational
[src]
fn cmp(&self, other: &Self) -> Ordering
[src]
#[must_use]pub fn max(self, other: Self) -> Self
1.21.0[src]
#[must_use]pub fn min(self, other: Self) -> Self
1.21.0[src]
#[must_use]pub fn clamp(self, min: Self, max: Self) -> Self
1.50.0[src]
impl PartialEq<(Integer, Integer)> for Rational
[src]
fn eq(&self, other: &(Integer, Integer)) -> bool
[src]
#[must_use]pub fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
impl PartialEq<(i128, i128)> for Rational
[src]
fn eq(&self, other: &(i128, i128)) -> bool
[src]
#[must_use]pub fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
impl PartialEq<(i16, i16)> for Rational
[src]
fn eq(&self, other: &(i16, i16)) -> bool
[src]
#[must_use]pub fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
impl PartialEq<(i32, i32)> for Rational
[src]
fn eq(&self, other: &(i32, i32)) -> bool
[src]
#[must_use]pub fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
impl PartialEq<(i64, i64)> for Rational
[src]
fn eq(&self, other: &(i64, i64)) -> bool
[src]
#[must_use]pub fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
impl PartialEq<(i8, i8)> for Rational
[src]
fn eq(&self, other: &(i8, i8)) -> bool
[src]
#[must_use]pub fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
impl PartialEq<(u128, u128)> for Rational
[src]
fn eq(&self, other: &(u128, u128)) -> bool
[src]
#[must_use]pub fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
impl PartialEq<(u16, u16)> for Rational
[src]
fn eq(&self, other: &(u16, u16)) -> bool
[src]
#[must_use]pub fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
impl PartialEq<(u32, u32)> for Rational
[src]
fn eq(&self, other: &(u32, u32)) -> bool
[src]
#[must_use]pub fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
impl PartialEq<(u64, u64)> for Rational
[src]
fn eq(&self, other: &(u64, u64)) -> bool
[src]
#[must_use]pub fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
impl PartialEq<(u8, u8)> for Rational
[src]
fn eq(&self, other: &(u8, u8)) -> bool
[src]
#[must_use]pub fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
impl PartialEq<Integer> for Rational
[src]
fn eq(&self, other: &Integer) -> bool
[src]
#[must_use]pub fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
impl PartialEq<Rational> for Rational
[src]
fn eq(&self, other: &Rational) -> bool
[src]
#[must_use]pub fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
impl PartialEq<Rational> for Integer
[src]
fn eq(&self, other: &Rational) -> bool
[src]
#[must_use]pub fn ne(&self, other: &Rhs) -> bool
1.0.0[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]
fn partial_cmp(&self, other: &(Integer, Integer)) -> Option<Ordering>
[src]
#[must_use]pub fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn ge(&self, other: &Rhs) -> bool
1.0.0[src]
impl PartialOrd<(i128, i128)> for Rational
[src]
fn partial_cmp(&self, other: &(i128, i128)) -> Option<Ordering>
[src]
#[must_use]pub fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn ge(&self, other: &Rhs) -> bool
1.0.0[src]
impl PartialOrd<(i16, i16)> for Rational
[src]
fn partial_cmp(&self, other: &(i16, i16)) -> Option<Ordering>
[src]
#[must_use]pub fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn ge(&self, other: &Rhs) -> bool
1.0.0[src]
impl PartialOrd<(i32, i32)> for Rational
[src]
fn partial_cmp(&self, other: &(i32, i32)) -> Option<Ordering>
[src]
#[must_use]pub fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn ge(&self, other: &Rhs) -> bool
1.0.0[src]
impl PartialOrd<(i64, i64)> for Rational
[src]
fn partial_cmp(&self, other: &(i64, i64)) -> Option<Ordering>
[src]
#[must_use]pub fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn ge(&self, other: &Rhs) -> bool
1.0.0[src]
impl PartialOrd<(i8, i8)> for Rational
[src]
fn partial_cmp(&self, other: &(i8, i8)) -> Option<Ordering>
[src]
#[must_use]pub fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn ge(&self, other: &Rhs) -> bool
1.0.0[src]
impl PartialOrd<(u128, u128)> for Rational
[src]
fn partial_cmp(&self, other: &(u128, u128)) -> Option<Ordering>
[src]
#[must_use]pub fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn ge(&self, other: &Rhs) -> bool
1.0.0[src]
impl PartialOrd<(u16, u16)> for Rational
[src]
fn partial_cmp(&self, other: &(u16, u16)) -> Option<Ordering>
[src]
#[must_use]pub fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn ge(&self, other: &Rhs) -> bool
1.0.0[src]
impl PartialOrd<(u32, u32)> for Rational
[src]
fn partial_cmp(&self, other: &(u32, u32)) -> Option<Ordering>
[src]
#[must_use]pub fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn ge(&self, other: &Rhs) -> bool
1.0.0[src]
impl PartialOrd<(u64, u64)> for Rational
[src]
fn partial_cmp(&self, other: &(u64, u64)) -> Option<Ordering>
[src]
#[must_use]pub fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn ge(&self, other: &Rhs) -> bool
1.0.0[src]
impl PartialOrd<(u8, u8)> for Rational
[src]
fn partial_cmp(&self, other: &(u8, u8)) -> Option<Ordering>
[src]
#[must_use]pub fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn ge(&self, other: &Rhs) -> bool
1.0.0[src]
impl PartialOrd<Integer> for Rational
[src]
fn partial_cmp(&self, other: &Integer) -> Option<Ordering>
[src]
#[must_use]pub fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn ge(&self, other: &Rhs) -> bool
1.0.0[src]
impl PartialOrd<Rational> for Rational
[src]
fn partial_cmp(&self, other: &Rational) -> Option<Ordering>
[src]
#[must_use]pub fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn ge(&self, other: &Rhs) -> bool
1.0.0[src]
impl PartialOrd<Rational> for Integer
[src]
fn partial_cmp(&self, other: &Rational) -> Option<Ordering>
[src]
#[must_use]pub fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn ge(&self, other: &Rhs) -> bool
1.0.0[src]
impl PartialOrd<i128> for Rational
[src]
fn partial_cmp(&self, other: &i128) -> Option<Ordering>
[src]
#[must_use]pub fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn ge(&self, other: &Rhs) -> bool
1.0.0[src]
impl PartialOrd<i16> for Rational
[src]
fn partial_cmp(&self, other: &i16) -> Option<Ordering>
[src]
#[must_use]pub fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn ge(&self, other: &Rhs) -> bool
1.0.0[src]
impl PartialOrd<i32> for Rational
[src]
fn partial_cmp(&self, other: &i32) -> Option<Ordering>
[src]
#[must_use]pub fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn ge(&self, other: &Rhs) -> bool
1.0.0[src]
impl PartialOrd<i64> for Rational
[src]
fn partial_cmp(&self, other: &i64) -> Option<Ordering>
[src]
#[must_use]pub fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn ge(&self, other: &Rhs) -> bool
1.0.0[src]
impl PartialOrd<i8> for Rational
[src]
fn partial_cmp(&self, other: &i8) -> Option<Ordering>
[src]
#[must_use]pub fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn ge(&self, other: &Rhs) -> bool
1.0.0[src]
impl PartialOrd<u128> for Rational
[src]
fn partial_cmp(&self, other: &u128) -> Option<Ordering>
[src]
#[must_use]pub fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn ge(&self, other: &Rhs) -> bool
1.0.0[src]
impl PartialOrd<u16> for Rational
[src]
fn partial_cmp(&self, other: &u16) -> Option<Ordering>
[src]
#[must_use]pub fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn ge(&self, other: &Rhs) -> bool
1.0.0[src]
impl PartialOrd<u32> for Rational
[src]
fn partial_cmp(&self, other: &u32) -> Option<Ordering>
[src]
#[must_use]pub fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn ge(&self, other: &Rhs) -> bool
1.0.0[src]
impl PartialOrd<u64> for Rational
[src]
fn partial_cmp(&self, other: &u64) -> Option<Ordering>
[src]
#[must_use]pub fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn ge(&self, other: &Rhs) -> bool
1.0.0[src]
impl PartialOrd<u8> for Rational
[src]
fn partial_cmp(&self, other: &u8) -> Option<Ordering>
[src]
#[must_use]pub fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn ge(&self, other: &Rhs) -> bool
1.0.0[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.
fn sub(self, rhs: &Integer) -> Self::Output
[src]
impl Sub<&'_ Integer> for &Rational
[src]
type Output = Rational
The resulting type after applying the -
operator.
fn sub(self, rhs: &Integer) -> Self::Output
[src]
impl Sub<&'_ Rational> for Rational
[src]
type Output = Rational
The resulting type after applying the -
operator.
fn sub(self, rhs: &Rational) -> Self::Output
[src]
impl Sub<&'_ Rational> for &Rational
[src]
type Output = Rational
The resulting type after applying the -
operator.
fn sub(self, rhs: &Rational) -> Self::Output
[src]
impl Sub<&'_ Rational> for Integer
[src]
type Output = Rational
The resulting type after applying the -
operator.
fn sub(self, rhs: &Rational) -> Self::Output
[src]
impl Sub<&'_ Rational> for &Integer
[src]
type Output = Rational
The resulting type after applying the -
operator.
fn sub(self, rhs: &Rational) -> Self::Output
[src]
impl Sub<&'_ i128> for Rational
[src]
type Output = Rational
The resulting type after applying the -
operator.
fn sub(self, rhs: &i128) -> Self::Output
[src]
impl Sub<&'_ i128> for &Rational
[src]
type Output = Rational
The resulting type after applying the -
operator.
fn sub(self, rhs: &i128) -> Self::Output
[src]
impl Sub<&'_ i16> for Rational
[src]
type Output = Rational
The resulting type after applying the -
operator.
fn sub(self, rhs: &i16) -> Self::Output
[src]
impl Sub<&'_ i16> for &Rational
[src]
type Output = Rational
The resulting type after applying the -
operator.
fn sub(self, rhs: &i16) -> Self::Output
[src]
impl Sub<&'_ i32> for Rational
[src]
type Output = Rational
The resulting type after applying the -
operator.
fn sub(self, rhs: &i32) -> Self::Output
[src]
impl Sub<&'_ i32> for &Rational
[src]
type Output = Rational
The resulting type after applying the -
operator.
fn sub(self, rhs: &i32) -> Self::Output
[src]
impl Sub<&'_ i64> for Rational
[src]
type Output = Rational
The resulting type after applying the -
operator.
fn sub(self, rhs: &i64) -> Self::Output
[src]
impl Sub<&'_ i64> for &Rational
[src]
type Output = Rational
The resulting type after applying the -
operator.
fn sub(self, rhs: &i64) -> Self::Output
[src]
impl Sub<&'_ i8> for Rational
[src]
type Output = Rational
The resulting type after applying the -
operator.
fn sub(self, rhs: &i8) -> Self::Output
[src]
impl Sub<&'_ i8> for &Rational
[src]
type Output = Rational
The resulting type after applying the -
operator.
fn sub(self, rhs: &i8) -> Self::Output
[src]
impl Sub<&'_ u128> for Rational
[src]
type Output = Rational
The resulting type after applying the -
operator.
fn sub(self, rhs: &u128) -> Self::Output
[src]
impl Sub<&'_ u128> for &Rational
[src]
type Output = Rational
The resulting type after applying the -
operator.
fn sub(self, rhs: &u128) -> Self::Output
[src]
impl Sub<&'_ u16> for Rational
[src]
type Output = Rational
The resulting type after applying the -
operator.
fn sub(self, rhs: &u16) -> Self::Output
[src]
impl Sub<&'_ u16> for &Rational
[src]
type Output = Rational
The resulting type after applying the -
operator.
fn sub(self, rhs: &u16) -> Self::Output
[src]
impl Sub<&'_ u32> for Rational
[src]
type Output = Rational
The resulting type after applying the -
operator.
fn sub(self, rhs: &u32) -> Self::Output
[src]
impl Sub<&'_ u32> for &Rational
[src]
type Output = Rational
The resulting type after applying the -
operator.
fn sub(self, rhs: &u32) -> Self::Output
[src]
impl Sub<&'_ u64> for Rational
[src]
type Output = Rational
The resulting type after applying the -
operator.
fn sub(self, rhs: &u64) -> Self::Output
[src]
impl Sub<&'_ u64> for &Rational
[src]
type Output = Rational
The resulting type after applying the -
operator.
fn sub(self, rhs: &u64) -> Self::Output
[src]
impl Sub<&'_ u8> for Rational
[src]
type Output = Rational
The resulting type after applying the -
operator.
fn sub(self, rhs: &u8) -> Self::Output
[src]
impl Sub<&'_ u8> for &Rational
[src]
type Output = Rational
The resulting type after applying the -
operator.
fn sub(self, rhs: &u8) -> Self::Output
[src]
impl Sub<Integer> for Rational
[src]
type Output = Rational
The resulting type after applying the -
operator.
fn sub(self, rhs: Integer) -> Self::Output
[src]
impl Sub<Integer> for &Rational
[src]
type Output = Rational
The resulting type after applying the -
operator.
fn sub(self, rhs: Integer) -> Self::Output
[src]
impl Sub<Rational> for Rational
[src]
type Output = Rational
The resulting type after applying the -
operator.
fn sub(self, rhs: Rational) -> Self::Output
[src]
impl Sub<Rational> for &Rational
[src]
type Output = Rational
The resulting type after applying the -
operator.
fn sub(self, rhs: Rational) -> Self::Output
[src]
impl Sub<Rational> for Integer
[src]
type Output = Rational
The resulting type after applying the -
operator.
fn sub(self, rhs: Rational) -> Self::Output
[src]
impl Sub<Rational> for &Integer
[src]
type Output = Rational
The resulting type after applying the -
operator.
fn sub(self, rhs: Rational) -> Self::Output
[src]
impl Sub<i128> for Rational
[src]
type Output = Rational
The resulting type after applying the -
operator.
fn sub(self, rhs: i128) -> Self::Output
[src]
impl Sub<i128> for &Rational
[src]
type Output = Rational
The resulting type after applying the -
operator.
fn sub(self, rhs: i128) -> Self::Output
[src]
impl Sub<i16> for Rational
[src]
type Output = Rational
The resulting type after applying the -
operator.
fn sub(self, rhs: i16) -> Self::Output
[src]
impl Sub<i16> for &Rational
[src]
type Output = Rational
The resulting type after applying the -
operator.
fn sub(self, rhs: i16) -> Self::Output
[src]
impl Sub<i32> for Rational
[src]
type Output = Rational
The resulting type after applying the -
operator.
fn sub(self, rhs: i32) -> Self::Output
[src]
impl Sub<i32> for &Rational
[src]
type Output = Rational
The resulting type after applying the -
operator.
fn sub(self, rhs: i32) -> Self::Output
[src]
impl Sub<i64> for Rational
[src]
type Output = Rational
The resulting type after applying the -
operator.
fn sub(self, rhs: i64) -> Self::Output
[src]
impl Sub<i64> for &Rational
[src]
type Output = Rational
The resulting type after applying the -
operator.
fn sub(self, rhs: i64) -> Self::Output
[src]
impl Sub<i8> for Rational
[src]
type Output = Rational
The resulting type after applying the -
operator.
fn sub(self, rhs: i8) -> Self::Output
[src]
impl Sub<i8> for &Rational
[src]
type Output = Rational
The resulting type after applying the -
operator.
fn sub(self, rhs: i8) -> Self::Output
[src]
impl Sub<u128> for Rational
[src]
type Output = Rational
The resulting type after applying the -
operator.
fn sub(self, rhs: u128) -> Self::Output
[src]
impl Sub<u128> for &Rational
[src]
type Output = Rational
The resulting type after applying the -
operator.
fn sub(self, rhs: u128) -> Self::Output
[src]
impl Sub<u16> for Rational
[src]
type Output = Rational
The resulting type after applying the -
operator.
fn sub(self, rhs: u16) -> Self::Output
[src]
impl Sub<u16> for &Rational
[src]
type Output = Rational
The resulting type after applying the -
operator.
fn sub(self, rhs: u16) -> Self::Output
[src]
impl Sub<u32> for Rational
[src]
type Output = Rational
The resulting type after applying the -
operator.
fn sub(self, rhs: u32) -> Self::Output
[src]
impl Sub<u32> for &Rational
[src]
type Output = Rational
The resulting type after applying the -
operator.
fn sub(self, rhs: u32) -> Self::Output
[src]
impl Sub<u64> for Rational
[src]
type Output = Rational
The resulting type after applying the -
operator.
fn sub(self, rhs: u64) -> Self::Output
[src]
impl Sub<u64> for &Rational
[src]
type Output = Rational
The resulting type after applying the -
operator.
fn sub(self, rhs: u64) -> Self::Output
[src]
impl Sub<u8> for Rational
[src]
type Output = Rational
The resulting type after applying the -
operator.
fn sub(self, rhs: u8) -> Self::Output
[src]
impl Sub<u8> for &Rational
[src]
type Output = Rational
The resulting type after applying the -
operator.
fn sub(self, rhs: u8) -> Self::Output
[src]
impl SubAssign<&'_ Integer> for Rational
[src]
fn sub_assign(&mut self, rhs: &Integer)
[src]
impl SubAssign<&'_ Rational> for Rational
[src]
fn sub_assign(&mut self, rhs: &Rational)
[src]
impl SubAssign<&'_ i128> for Rational
[src]
fn sub_assign(&mut self, rhs: &i128)
[src]
impl SubAssign<&'_ i16> for Rational
[src]
fn sub_assign(&mut self, rhs: &i16)
[src]
impl SubAssign<&'_ i32> for Rational
[src]
fn sub_assign(&mut self, rhs: &i32)
[src]
impl SubAssign<&'_ i64> for Rational
[src]
fn sub_assign(&mut self, rhs: &i64)
[src]
impl SubAssign<&'_ i8> for Rational
[src]
fn sub_assign(&mut self, rhs: &i8)
[src]
impl SubAssign<&'_ u128> for Rational
[src]
fn sub_assign(&mut self, rhs: &u128)
[src]
impl SubAssign<&'_ u16> for Rational
[src]
fn sub_assign(&mut self, rhs: &u16)
[src]
impl SubAssign<&'_ u32> for Rational
[src]
fn sub_assign(&mut self, rhs: &u32)
[src]
impl SubAssign<&'_ u64> for Rational
[src]
fn sub_assign(&mut self, rhs: &u64)
[src]
impl SubAssign<&'_ u8> for Rational
[src]
fn sub_assign(&mut self, rhs: &u8)
[src]
impl SubAssign<Integer> for Rational
[src]
fn sub_assign(&mut self, rhs: Integer)
[src]
impl SubAssign<Rational> for Rational
[src]
fn sub_assign(&mut self, rhs: Rational)
[src]
impl SubAssign<i128> for Rational
[src]
fn sub_assign(&mut self, rhs: i128)
[src]
impl SubAssign<i16> for Rational
[src]
fn sub_assign(&mut self, rhs: i16)
[src]
impl SubAssign<i32> for Rational
[src]
fn sub_assign(&mut self, rhs: i32)
[src]
impl SubAssign<i64> for Rational
[src]
fn sub_assign(&mut self, rhs: i64)
[src]
impl SubAssign<i8> for Rational
[src]
fn sub_assign(&mut self, rhs: i8)
[src]
impl SubAssign<u128> for Rational
[src]
fn sub_assign(&mut self, rhs: u128)
[src]
impl SubAssign<u16> for Rational
[src]
fn sub_assign(&mut self, rhs: u16)
[src]
impl SubAssign<u32> for Rational
[src]
fn sub_assign(&mut self, rhs: u32)
[src]
impl SubAssign<u64> for Rational
[src]
fn sub_assign(&mut self, rhs: u64)
[src]
impl SubAssign<u8> for Rational
[src]
fn sub_assign(&mut self, rhs: u8)
[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.
fn try_from(src: &Rational) -> Result<Self, Self::Error>
[src]
impl TryFrom<Rational> for Integer
[src]
Auto Trait Implementations
impl RefUnwindSafe for Rational
impl !Sync for Rational
impl Unpin for Rational
impl UnwindSafe for Rational
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,