#[repr(align(16))]pub enum SimpleNumber {
FixedInteger(i64),
BigInteger(Integer),
Rational(Rational),
Real(f64),
}Expand description
Scheme simple numeric type (i.e. numbers that satisfy real?)
Variants§
Implementations§
Source§impl SimpleNumber
impl SimpleNumber
pub fn zero() -> Self
pub fn one() -> Self
pub fn infinity() -> Self
pub fn neg_infinity() -> Self
pub fn is_zero(&self) -> bool
pub fn is_one(&self) -> bool
pub fn is_neg_one(&self) -> bool
pub fn is_exact(&self) -> bool
pub fn to_string(&self, radix: u32, precision: Option<usize>) -> Option<String>
pub fn is_nan(&self) -> bool
pub fn is_finite(&self) -> bool
pub fn is_infinite(&self) -> bool
pub fn is_negative(&self) -> bool
pub fn is_positive(&self) -> bool
pub fn is_integer(&self) -> bool
pub fn is_rational(&self) -> bool
pub fn to_integer(&self, rounding_mode: RoundingMode) -> Self
pub fn inexact(&self) -> Self
pub fn exact(&self) -> Self
pub fn abs(&self) -> Self
pub fn powi(&self, p: i32) -> Self
pub fn div_euclid(&self, rhs: &Self) -> Self
pub fn pow(&self, p: &SimpleNumber) -> Self
pub fn sqrt(&self) -> Self
pub fn eqv(&self, rhs: &Self) -> bool
pub fn to_f64(&self) -> f64
pub fn exp(&self) -> Self
pub fn ln(&self) -> Self
pub fn sin(&self) -> Self
pub fn cos(&self) -> Self
pub fn tan(&self) -> Self
pub fn sinh(&self) -> Self
pub fn cosh(&self) -> Self
pub fn tanh(&self) -> Self
pub fn asin(&self) -> Self
pub fn acos(&self) -> Self
pub fn atan(&self) -> Self
pub fn atan2(&self, num2: &Self) -> Self
Trait Implementations§
Source§impl Add for &SimpleNumber
impl Add for &SimpleNumber
Source§type Output = SimpleNumber
type Output = SimpleNumber
The resulting type after applying the
+ operator.Source§fn add(self, rhs: &SimpleNumber) -> SimpleNumber
fn add(self, rhs: &SimpleNumber) -> SimpleNumber
Performs the
+ operation. Read moreSource§impl Add for SimpleNumber
impl Add for SimpleNumber
Source§type Output = SimpleNumber
type Output = SimpleNumber
The resulting type after applying the
+ operator.Source§fn add(self, rhs: SimpleNumber) -> SimpleNumber
fn add(self, rhs: SimpleNumber) -> SimpleNumber
Performs the
+ operation. Read moreSource§impl Clone for SimpleNumber
impl Clone for SimpleNumber
Source§fn clone(&self) -> SimpleNumber
fn clone(&self) -> SimpleNumber
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for SimpleNumber
impl Debug for SimpleNumber
Source§impl Display for SimpleNumber
impl Display for SimpleNumber
Source§impl Div for &SimpleNumber
impl Div for &SimpleNumber
Source§type Output = SimpleNumber
type Output = SimpleNumber
The resulting type after applying the
/ operator.Source§fn div(self, rhs: &SimpleNumber) -> SimpleNumber
fn div(self, rhs: &SimpleNumber) -> SimpleNumber
Performs the
/ operation. Read moreSource§impl Div for SimpleNumber
impl Div for SimpleNumber
Source§type Output = SimpleNumber
type Output = SimpleNumber
The resulting type after applying the
/ operator.Source§fn div(self, rhs: SimpleNumber) -> SimpleNumber
fn div(self, rhs: SimpleNumber) -> SimpleNumber
Performs the
/ operation. Read moreSource§impl From<Integer> for SimpleNumber
impl From<Integer> for SimpleNumber
Source§impl From<Rational> for SimpleNumber
impl From<Rational> for SimpleNumber
Source§impl From<SimpleNumber> for ComplexNumber
impl From<SimpleNumber> for ComplexNumber
Source§fn from(value: SimpleNumber) -> Self
fn from(value: SimpleNumber) -> Self
Converts to this type from the input type.
Source§impl From<SimpleNumber> for Value
impl From<SimpleNumber> for Value
Source§fn from(n: SimpleNumber) -> Self
fn from(n: SimpleNumber) -> Self
Converts to this type from the input type.
Source§impl From<f64> for SimpleNumber
impl From<f64> for SimpleNumber
Source§impl From<i128> for SimpleNumber
impl From<i128> for SimpleNumber
Source§impl From<i16> for SimpleNumber
impl From<i16> for SimpleNumber
Source§impl From<i32> for SimpleNumber
impl From<i32> for SimpleNumber
Source§impl From<i64> for SimpleNumber
impl From<i64> for SimpleNumber
Source§impl From<i8> for SimpleNumber
impl From<i8> for SimpleNumber
Source§impl From<isize> for SimpleNumber
impl From<isize> for SimpleNumber
Source§impl From<u128> for SimpleNumber
impl From<u128> for SimpleNumber
Source§impl From<u16> for SimpleNumber
impl From<u16> for SimpleNumber
Source§impl From<u32> for SimpleNumber
impl From<u32> for SimpleNumber
Source§impl From<u64> for SimpleNumber
impl From<u64> for SimpleNumber
Source§impl From<u8> for SimpleNumber
impl From<u8> for SimpleNumber
Source§impl From<usize> for SimpleNumber
impl From<usize> for SimpleNumber
Source§impl Hash for SimpleNumber
Hash implementation for SimpleNumber is the eqv-hash procedure from r6rs.
impl Hash for SimpleNumber
Hash implementation for SimpleNumber is the eqv-hash procedure from r6rs.
Source§impl Mul for &SimpleNumber
impl Mul for &SimpleNumber
Source§type Output = SimpleNumber
type Output = SimpleNumber
The resulting type after applying the
* operator.Source§fn mul(self, rhs: &SimpleNumber) -> SimpleNumber
fn mul(self, rhs: &SimpleNumber) -> SimpleNumber
Performs the
* operation. Read moreSource§impl Mul for SimpleNumber
impl Mul for SimpleNumber
Source§type Output = SimpleNumber
type Output = SimpleNumber
The resulting type after applying the
* operator.Source§fn mul(self, rhs: SimpleNumber) -> SimpleNumber
fn mul(self, rhs: SimpleNumber) -> SimpleNumber
Performs the
* operation. Read moreSource§impl Neg for &SimpleNumber
impl Neg for &SimpleNumber
Source§type Output = SimpleNumber
type Output = SimpleNumber
The resulting type after applying the
- operator.Source§fn neg(self) -> SimpleNumber
fn neg(self) -> SimpleNumber
Performs the unary
- operation. Read moreSource§impl Neg for SimpleNumber
impl Neg for SimpleNumber
Source§impl PartialEq for SimpleNumber
impl PartialEq for SimpleNumber
Source§impl PartialOrd for SimpleNumber
impl PartialOrd for SimpleNumber
Source§impl Rem for &SimpleNumber
impl Rem for &SimpleNumber
Source§type Output = SimpleNumber
type Output = SimpleNumber
The resulting type after applying the
% operator.Source§fn rem(self, rhs: &SimpleNumber) -> SimpleNumber
fn rem(self, rhs: &SimpleNumber) -> SimpleNumber
Performs the
% operation. Read moreSource§impl Rem for SimpleNumber
impl Rem for SimpleNumber
Source§type Output = SimpleNumber
type Output = SimpleNumber
The resulting type after applying the
% operator.Source§fn rem(self, rhs: SimpleNumber) -> SimpleNumber
fn rem(self, rhs: SimpleNumber) -> SimpleNumber
Performs the
% operation. Read moreSource§impl Sub for &SimpleNumber
impl Sub for &SimpleNumber
Source§type Output = SimpleNumber
type Output = SimpleNumber
The resulting type after applying the
- operator.Source§fn sub(self, rhs: &SimpleNumber) -> SimpleNumber
fn sub(self, rhs: &SimpleNumber) -> SimpleNumber
Performs the
- operation. Read moreSource§impl Sub for SimpleNumber
impl Sub for SimpleNumber
Source§type Output = SimpleNumber
type Output = SimpleNumber
The resulting type after applying the
- operator.Source§fn sub(self, rhs: SimpleNumber) -> SimpleNumber
fn sub(self, rhs: SimpleNumber) -> SimpleNumber
Performs the
- operation. Read moreSource§impl TryFrom<&Number> for SimpleNumber
impl TryFrom<&Number> for SimpleNumber
Source§impl TryFrom<&SimpleNumber> for Integer
impl TryFrom<&SimpleNumber> for Integer
Source§impl TryFrom<&SimpleNumber> for f64
impl TryFrom<&SimpleNumber> for f64
Source§impl TryFrom<&SimpleNumber> for i128
impl TryFrom<&SimpleNumber> for i128
Source§impl TryFrom<&SimpleNumber> for i16
impl TryFrom<&SimpleNumber> for i16
Source§impl TryFrom<&SimpleNumber> for i32
impl TryFrom<&SimpleNumber> for i32
Source§impl TryFrom<&SimpleNumber> for i64
impl TryFrom<&SimpleNumber> for i64
Source§impl TryFrom<&SimpleNumber> for i8
impl TryFrom<&SimpleNumber> for i8
Source§impl TryFrom<&SimpleNumber> for isize
impl TryFrom<&SimpleNumber> for isize
Source§impl TryFrom<&SimpleNumber> for u128
impl TryFrom<&SimpleNumber> for u128
Source§impl TryFrom<&SimpleNumber> for u16
impl TryFrom<&SimpleNumber> for u16
Source§impl TryFrom<&SimpleNumber> for u32
impl TryFrom<&SimpleNumber> for u32
Source§impl TryFrom<&SimpleNumber> for u64
impl TryFrom<&SimpleNumber> for u64
Source§impl TryFrom<&SimpleNumber> for u8
impl TryFrom<&SimpleNumber> for u8
Source§impl TryFrom<&SimpleNumber> for usize
impl TryFrom<&SimpleNumber> for usize
Source§impl TryFrom<&Value> for SimpleNumber
impl TryFrom<&Value> for SimpleNumber
Source§impl TryFrom<(Part, u32)> for SimpleNumber
impl TryFrom<(Part, u32)> for SimpleNumber
Source§impl TryFrom<Number> for SimpleNumber
impl TryFrom<Number> for SimpleNumber
Source§impl TryFrom<SimpleNumber> for Integer
impl TryFrom<SimpleNumber> for Integer
Source§impl TryFrom<SimpleNumber> for f64
impl TryFrom<SimpleNumber> for f64
Source§impl TryFrom<SimpleNumber> for i128
impl TryFrom<SimpleNumber> for i128
Source§impl TryFrom<SimpleNumber> for i16
impl TryFrom<SimpleNumber> for i16
Source§impl TryFrom<SimpleNumber> for i32
impl TryFrom<SimpleNumber> for i32
Source§impl TryFrom<SimpleNumber> for i64
impl TryFrom<SimpleNumber> for i64
Source§impl TryFrom<SimpleNumber> for i8
impl TryFrom<SimpleNumber> for i8
Source§impl TryFrom<SimpleNumber> for isize
impl TryFrom<SimpleNumber> for isize
Source§impl TryFrom<SimpleNumber> for u128
impl TryFrom<SimpleNumber> for u128
Source§impl TryFrom<SimpleNumber> for u16
impl TryFrom<SimpleNumber> for u16
Source§impl TryFrom<SimpleNumber> for u32
impl TryFrom<SimpleNumber> for u32
Source§impl TryFrom<SimpleNumber> for u64
impl TryFrom<SimpleNumber> for u64
Source§impl TryFrom<SimpleNumber> for u8
impl TryFrom<SimpleNumber> for u8
Source§impl TryFrom<SimpleNumber> for usize
impl TryFrom<SimpleNumber> for usize
Auto Trait Implementations§
impl Freeze for SimpleNumber
impl RefUnwindSafe for SimpleNumber
impl Send for SimpleNumber
impl Sync for SimpleNumber
impl Unpin for SimpleNumber
impl UnwindSafe for SimpleNumber
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more