Struct dual_num::Dual [−][src]
pub struct Dual<T: Scalar>(_);
Dual Number structure
Although Dual
does implement PartialEq
and PartialOrd
,
it only compares the real part.
Additionally, min
and max
only compare the real parts, and keep the dual parts.
Lastly, the Rem
remainder operator is not correctly or fully defined for Dual
, and will panic.
Methods
impl<T: Scalar> Dual<T>
[src]
impl<T: Scalar> Dual<T>
pub fn new(real: T, dual: T) -> Dual<T>
[src]
pub fn new(real: T, dual: T) -> Dual<T>
Create a new dual number from its real and dual parts.
pub fn from_real(real: T) -> Dual<T> where
T: Zero,
[src]
pub fn from_real(real: T) -> Dual<T> where
T: Zero,
Create a new dual number from a real number.
The dual part is set to zero.
pub fn real(&self) -> T
[src]
pub fn real(&self) -> T
Returns the real part
pub fn dual(&self) -> T
[src]
pub fn dual(&self) -> T
Returns the dual part
pub fn into_tuple(self) -> (T, T)
[src]
pub fn into_tuple(self) -> (T, T)
Returns both real and dual parts as a tuple
ⓘImportant traits for &'a mut Rpub fn real_ref(&self) -> &T
[src]
pub fn real_ref(&self) -> &T
Returns a reference to the real part
ⓘImportant traits for &'a mut Rpub fn dual_ref(&self) -> &T
[src]
pub fn dual_ref(&self) -> &T
Returns a reference to the dual part
ⓘImportant traits for &'a mut Rpub fn real_mut(&mut self) -> &mut T
[src]
pub fn real_mut(&mut self) -> &mut T
Returns a mutable reference to the real part
ⓘImportant traits for &'a mut Rpub fn dual_mut(&mut self) -> &mut T
[src]
pub fn dual_mut(&mut self) -> &mut T
Returns a mutable reference to the dual part
impl<T: Scalar + Neg<Output = T>> Dual<T>
[src]
impl<T: Scalar + Neg<Output = T>> Dual<T>
Trait Implementations
impl<T: Clone + Scalar> Clone for Dual<T>
[src]
impl<T: Clone + Scalar> Clone for Dual<T>
fn clone(&self) -> Dual<T>
[src]
fn clone(&self) -> Dual<T>
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
impl<T: Copy + Scalar> Copy for Dual<T>
[src]
impl<T: Copy + Scalar> Copy for Dual<T>
impl<T: Scalar> Debug for Dual<T>
[src]
impl<T: Scalar> Debug for Dual<T>
fn fmt(&self, f: &mut Formatter) -> FmtResult
[src]
fn fmt(&self, f: &mut Formatter) -> FmtResult
Formats the value using the given formatter. Read more
impl<T: Scalar + Zero> From<T> for Dual<T>
[src]
impl<T: Scalar + Zero> From<T> for Dual<T>
impl<T: Scalar> Deref for Dual<T>
[src]
impl<T: Scalar> Deref for Dual<T>
type Target = Vector2<T>
The resulting type after dereferencing.
fn deref(&self) -> &Vector2<T>
[src]
fn deref(&self) -> &Vector2<T>
Dereferences the value.
impl<T: Scalar> DerefMut for Dual<T>
[src]
impl<T: Scalar> DerefMut for Dual<T>
impl<T: Scalar + Display> Display for Dual<T>
[src]
impl<T: Scalar + Display> Display for Dual<T>
fn fmt(&self, f: &mut Formatter) -> FmtResult
[src]
fn fmt(&self, f: &mut Formatter) -> FmtResult
Formats the value using the given formatter. Read more
impl<T: Scalar + PartialEq> PartialEq<Self> for Dual<T>
[src]
impl<T: Scalar + PartialEq> PartialEq<Self> for Dual<T>
fn eq(&self, rhs: &Self) -> bool
[src]
fn eq(&self, rhs: &Self) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
fn ne(&self, other: &Rhs) -> bool
This method tests for !=
.
impl<T: Scalar + PartialOrd> PartialOrd<Self> for Dual<T>
[src]
impl<T: Scalar + PartialOrd> PartialOrd<Self> for Dual<T>
fn partial_cmp(&self, rhs: &Self) -> Option<Ordering>
[src]
fn partial_cmp(&self, rhs: &Self) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
fn lt(&self, rhs: &Self) -> bool
[src]
fn lt(&self, rhs: &Self) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
fn gt(&self, rhs: &Self) -> bool
[src]
fn gt(&self, rhs: &Self) -> bool
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
fn le(&self, other: &Rhs) -> bool
1.0.0[src]
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
fn ge(&self, other: &Rhs) -> bool
1.0.0[src]
fn ge(&self, other: &Rhs) -> bool
This method tests greater than or equal to (for self
and other
) and is used by the >=
operator. Read more
impl<T: Scalar + PartialEq> PartialEq<T> for Dual<T>
[src]
impl<T: Scalar + PartialEq> PartialEq<T> for Dual<T>
fn eq(&self, rhs: &T) -> bool
[src]
fn eq(&self, rhs: &T) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
fn ne(&self, other: &Rhs) -> bool
This method tests for !=
.
impl<T: Scalar + PartialOrd> PartialOrd<T> for Dual<T>
[src]
impl<T: Scalar + PartialOrd> PartialOrd<T> for Dual<T>
fn partial_cmp(&self, rhs: &T) -> Option<Ordering>
[src]
fn partial_cmp(&self, rhs: &T) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
fn lt(&self, rhs: &T) -> bool
[src]
fn lt(&self, rhs: &T) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
fn gt(&self, rhs: &T) -> bool
[src]
fn gt(&self, rhs: &T) -> bool
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
fn le(&self, other: &Rhs) -> bool
1.0.0[src]
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
fn ge(&self, other: &Rhs) -> bool
1.0.0[src]
fn ge(&self, other: &Rhs) -> bool
This method tests greater than or equal to (for self
and other
) and is used by the >=
operator. Read more
impl<T: Scalar + ToPrimitive> ToPrimitive for Dual<T>
[src]
impl<T: Scalar + ToPrimitive> ToPrimitive for Dual<T>
fn to_isize(&self) -> Option<isize>
[src]
fn to_isize(&self) -> Option<isize>
Converts the value of self
to an isize
.
fn to_i8(&self) -> Option<i8>
[src]
fn to_i8(&self) -> Option<i8>
Converts the value of self
to an i8
.
fn to_i16(&self) -> Option<i16>
[src]
fn to_i16(&self) -> Option<i16>
Converts the value of self
to an i16
.
fn to_i32(&self) -> Option<i32>
[src]
fn to_i32(&self) -> Option<i32>
Converts the value of self
to an i32
.
fn to_i64(&self) -> Option<i64>
[src]
fn to_i64(&self) -> Option<i64>
Converts the value of self
to an i64
.
fn to_usize(&self) -> Option<usize>
[src]
fn to_usize(&self) -> Option<usize>
Converts the value of self
to a usize
.
fn to_u8(&self) -> Option<u8>
[src]
fn to_u8(&self) -> Option<u8>
Converts the value of self
to an u8
.
fn to_u16(&self) -> Option<u16>
[src]
fn to_u16(&self) -> Option<u16>
Converts the value of self
to an u16
.
fn to_u32(&self) -> Option<u32>
[src]
fn to_u32(&self) -> Option<u32>
Converts the value of self
to an u32
.
fn to_u64(&self) -> Option<u64>
[src]
fn to_u64(&self) -> Option<u64>
Converts the value of self
to an u64
.
fn to_f32(&self) -> Option<f32>
[src]
fn to_f32(&self) -> Option<f32>
Converts the value of self
to an f32
.
fn to_f64(&self) -> Option<f64>
[src]
fn to_f64(&self) -> Option<f64>
Converts the value of self
to an f64
.
fn to_i128(&self) -> Option<i128>
[src]
fn to_i128(&self) -> Option<i128>
Converts the value of self
to an i128
. Read more
fn to_u128(&self) -> Option<u128>
[src]
fn to_u128(&self) -> Option<u128>
Converts the value of self
to an u128
. Read more
impl<T: Scalar + FromPrimitive> FromPrimitive for Dual<T> where
T: Zero,
[src]
impl<T: Scalar + FromPrimitive> FromPrimitive for Dual<T> where
T: Zero,
fn from_isize(n: isize) -> Option<Dual<T>>
[src]
fn from_isize(n: isize) -> Option<Dual<T>>
Convert an isize
to return an optional value of this type. If the value cannot be represented by this value, then None
is returned. Read more
fn from_i8(n: i8) -> Option<Dual<T>>
[src]
fn from_i8(n: i8) -> Option<Dual<T>>
Convert an i8
to return an optional value of this type. If the type cannot be represented by this value, then None
is returned. Read more
fn from_i16(n: i16) -> Option<Dual<T>>
[src]
fn from_i16(n: i16) -> Option<Dual<T>>
Convert an i16
to return an optional value of this type. If the type cannot be represented by this value, then None
is returned. Read more
fn from_i32(n: i32) -> Option<Dual<T>>
[src]
fn from_i32(n: i32) -> Option<Dual<T>>
Convert an i32
to return an optional value of this type. If the type cannot be represented by this value, then None
is returned. Read more
fn from_i64(n: i64) -> Option<Dual<T>>
[src]
fn from_i64(n: i64) -> Option<Dual<T>>
Convert an i64
to return an optional value of this type. If the type cannot be represented by this value, then None
is returned. Read more
fn from_usize(n: usize) -> Option<Dual<T>>
[src]
fn from_usize(n: usize) -> Option<Dual<T>>
Convert a usize
to return an optional value of this type. If the type cannot be represented by this value, then None
is returned. Read more
fn from_u8(n: u8) -> Option<Dual<T>>
[src]
fn from_u8(n: u8) -> Option<Dual<T>>
Convert an u8
to return an optional value of this type. If the type cannot be represented by this value, then None
is returned. Read more
fn from_u16(n: u16) -> Option<Dual<T>>
[src]
fn from_u16(n: u16) -> Option<Dual<T>>
Convert an u16
to return an optional value of this type. If the type cannot be represented by this value, then None
is returned. Read more
fn from_u32(n: u32) -> Option<Dual<T>>
[src]
fn from_u32(n: u32) -> Option<Dual<T>>
Convert an u32
to return an optional value of this type. If the type cannot be represented by this value, then None
is returned. Read more
fn from_u64(n: u64) -> Option<Dual<T>>
[src]
fn from_u64(n: u64) -> Option<Dual<T>>
Convert an u64
to return an optional value of this type. If the type cannot be represented by this value, then None
is returned. Read more
fn from_f32(n: f32) -> Option<Dual<T>>
[src]
fn from_f32(n: f32) -> Option<Dual<T>>
Convert a f32
to return an optional value of this type. If the type cannot be represented by this value, then None
is returned. Read more
fn from_f64(n: f64) -> Option<Dual<T>>
[src]
fn from_f64(n: f64) -> Option<Dual<T>>
Convert a f64
to return an optional value of this type. If the type cannot be represented by this value, then None
is returned. Read more
fn from_i128(n: i128) -> Option<Self>
[src]
fn from_i128(n: i128) -> Option<Self>
Convert an i128
to return an optional value of this type. If the type cannot be represented by this value, then None
is returned. Read more
fn from_u128(n: u128) -> Option<Self>
[src]
fn from_u128(n: u128) -> Option<Self>
Convert an u128
to return an optional value of this type. If the type cannot be represented by this value, then None
is returned. Read more
impl<T: Scalar + Num> Add<T> for Dual<T>
[src]
impl<T: Scalar + Num> Add<T> for Dual<T>
type Output = Dual<T>
The resulting type after applying the +
operator.
fn add(self, rhs: T) -> Dual<T>
[src]
fn add(self, rhs: T) -> Dual<T>
Performs the +
operation.
impl<T: Scalar + Num> AddAssign<T> for Dual<T>
[src]
impl<T: Scalar + Num> AddAssign<T> for Dual<T>
fn add_assign(&mut self, rhs: T)
[src]
fn add_assign(&mut self, rhs: T)
Performs the +=
operation.
impl<T: Scalar + Num> Sub<T> for Dual<T>
[src]
impl<T: Scalar + Num> Sub<T> for Dual<T>
type Output = Dual<T>
The resulting type after applying the -
operator.
fn sub(self, rhs: T) -> Dual<T>
[src]
fn sub(self, rhs: T) -> Dual<T>
Performs the -
operation.
impl<T: Scalar + Num> SubAssign<T> for Dual<T>
[src]
impl<T: Scalar + Num> SubAssign<T> for Dual<T>
fn sub_assign(&mut self, rhs: T)
[src]
fn sub_assign(&mut self, rhs: T)
Performs the -=
operation.
impl<T: Scalar + Num> Mul<T> for Dual<T>
[src]
impl<T: Scalar + Num> Mul<T> for Dual<T>
type Output = Dual<T>
The resulting type after applying the *
operator.
fn mul(self, rhs: T) -> Dual<T>
[src]
fn mul(self, rhs: T) -> Dual<T>
Performs the *
operation.
impl<T: Scalar + Num> MulAssign<T> for Dual<T>
[src]
impl<T: Scalar + Num> MulAssign<T> for Dual<T>
fn mul_assign(&mut self, rhs: T)
[src]
fn mul_assign(&mut self, rhs: T)
Performs the *=
operation.
impl<T: Scalar + Num> Div<T> for Dual<T>
[src]
impl<T: Scalar + Num> Div<T> for Dual<T>
type Output = Dual<T>
The resulting type after applying the /
operator.
fn div(self, rhs: T) -> Dual<T>
[src]
fn div(self, rhs: T) -> Dual<T>
Performs the /
operation.
impl<T: Scalar + Num> DivAssign<T> for Dual<T>
[src]
impl<T: Scalar + Num> DivAssign<T> for Dual<T>
fn div_assign(&mut self, rhs: T)
[src]
fn div_assign(&mut self, rhs: T)
Performs the /=
operation.
impl<T: Scalar + Signed> Neg for Dual<T>
[src]
impl<T: Scalar + Signed> Neg for Dual<T>
type Output = Self
The resulting type after applying the -
operator.
fn neg(self) -> Self
[src]
fn neg(self) -> Self
Performs the unary -
operation.
impl<T: Scalar + Num> Add<Self> for Dual<T>
[src]
impl<T: Scalar + Num> Add<Self> for Dual<T>
type Output = Self
The resulting type after applying the +
operator.
fn add(self, rhs: Self) -> Self
[src]
fn add(self, rhs: Self) -> Self
Performs the +
operation.
impl<T: Scalar + Num> AddAssign<Self> for Dual<T>
[src]
impl<T: Scalar + Num> AddAssign<Self> for Dual<T>
fn add_assign(&mut self, rhs: Self)
[src]
fn add_assign(&mut self, rhs: Self)
Performs the +=
operation.
impl<T: Scalar + Num> Sub<Self> for Dual<T>
[src]
impl<T: Scalar + Num> Sub<Self> for Dual<T>
type Output = Self
The resulting type after applying the -
operator.
fn sub(self, rhs: Self) -> Self
[src]
fn sub(self, rhs: Self) -> Self
Performs the -
operation.
impl<T: Scalar + Num> SubAssign<Self> for Dual<T>
[src]
impl<T: Scalar + Num> SubAssign<Self> for Dual<T>
fn sub_assign(&mut self, rhs: Self)
[src]
fn sub_assign(&mut self, rhs: Self)
Performs the -=
operation.
impl<T: Scalar + Num> Mul<Self> for Dual<T>
[src]
impl<T: Scalar + Num> Mul<Self> for Dual<T>
type Output = Self
The resulting type after applying the *
operator.
fn mul(self, rhs: Self) -> Self
[src]
fn mul(self, rhs: Self) -> Self
Performs the *
operation.
impl<T: Scalar + Num> MulAssign<Self> for Dual<T>
[src]
impl<T: Scalar + Num> MulAssign<Self> for Dual<T>
fn mul_assign(&mut self, rhs: Self)
[src]
fn mul_assign(&mut self, rhs: Self)
Performs the *=
operation.
impl<T: Scalar + Num + Mul + Add> MulAdd<Self, Self> for Dual<T>
[src]
impl<T: Scalar + Num + Mul + Add> MulAdd<Self, Self> for Dual<T>
type Output = Dual<T>
The resulting type after applying the fused multiply-add.
fn mul_add(self, a: Self, b: Self) -> Dual<T>
[src]
fn mul_add(self, a: Self, b: Self) -> Dual<T>
Performs the fused multiply-add operation.
impl<T: Scalar + Num + Mul + Add> MulAddAssign<Self, Self> for Dual<T>
[src]
impl<T: Scalar + Num + Mul + Add> MulAddAssign<Self, Self> for Dual<T>
fn mul_add_assign(&mut self, a: Self, b: Self)
[src]
fn mul_add_assign(&mut self, a: Self, b: Self)
Performs the fused multiply-add operation.
impl<T: Scalar + Num + Mul + Add> MulAdd<T, Self> for Dual<T>
[src]
impl<T: Scalar + Num + Mul + Add> MulAdd<T, Self> for Dual<T>
type Output = Dual<T>
The resulting type after applying the fused multiply-add.
fn mul_add(self, a: T, b: Self) -> Dual<T>
[src]
fn mul_add(self, a: T, b: Self) -> Dual<T>
Performs the fused multiply-add operation.
impl<T: Scalar + Num + Mul + Add> MulAddAssign<T, Self> for Dual<T>
[src]
impl<T: Scalar + Num + Mul + Add> MulAddAssign<T, Self> for Dual<T>
fn mul_add_assign(&mut self, a: T, b: Self)
[src]
fn mul_add_assign(&mut self, a: T, b: Self)
Performs the fused multiply-add operation.
impl<T: Scalar + Num + Mul + Add> MulAdd<Self, T> for Dual<T>
[src]
impl<T: Scalar + Num + Mul + Add> MulAdd<Self, T> for Dual<T>
type Output = Dual<T>
The resulting type after applying the fused multiply-add.
fn mul_add(self, a: Self, b: T) -> Dual<T>
[src]
fn mul_add(self, a: Self, b: T) -> Dual<T>
Performs the fused multiply-add operation.
impl<T: Scalar + Num + Mul + Add> MulAddAssign<Self, T> for Dual<T>
[src]
impl<T: Scalar + Num + Mul + Add> MulAddAssign<Self, T> for Dual<T>
fn mul_add_assign(&mut self, a: Self, b: T)
[src]
fn mul_add_assign(&mut self, a: Self, b: T)
Performs the fused multiply-add operation.
impl<T: Scalar + Num + Mul + Add> MulAdd<T, T> for Dual<T>
[src]
impl<T: Scalar + Num + Mul + Add> MulAdd<T, T> for Dual<T>
type Output = Dual<T>
The resulting type after applying the fused multiply-add.
fn mul_add(self, a: T, b: T) -> Dual<T>
[src]
fn mul_add(self, a: T, b: T) -> Dual<T>
Performs the fused multiply-add operation.
impl<T: Scalar + Num + Mul + Add> MulAddAssign<T, T> for Dual<T>
[src]
impl<T: Scalar + Num + Mul + Add> MulAddAssign<T, T> for Dual<T>
fn mul_add_assign(&mut self, a: T, b: T)
[src]
fn mul_add_assign(&mut self, a: T, b: T)
Performs the fused multiply-add operation.
impl<T: Scalar + Num> Div<Self> for Dual<T>
[src]
impl<T: Scalar + Num> Div<Self> for Dual<T>
type Output = Self
The resulting type after applying the /
operator.
fn div(self, rhs: Self) -> Self
[src]
fn div(self, rhs: Self) -> Self
Performs the /
operation.
impl<T: Scalar + Num> DivAssign<Self> for Dual<T>
[src]
impl<T: Scalar + Num> DivAssign<Self> for Dual<T>
fn div_assign(&mut self, rhs: Self)
[src]
fn div_assign(&mut self, rhs: Self)
Performs the /=
operation.
impl<T: Scalar + Num> Rem<Self> for Dual<T>
[src]
impl<T: Scalar + Num> Rem<Self> for Dual<T>
type Output = Self
The resulting type after applying the %
operator.
fn rem(self, _: Self) -> Self
[src]
fn rem(self, _: Self) -> Self
UNIMPLEMENTED!!!
As far as I know, remainder is not a valid operation on dual numbers,
but is required for the Float
trait to be implemented.
impl<T: Scalar, P: Into<Dual<T>>> Pow<P> for Dual<T> where
Dual<T>: Float,
[src]
impl<T: Scalar, P: Into<Dual<T>>> Pow<P> for Dual<T> where
Dual<T>: Float,
type Output = Dual<T>
The result after applying the operator.
fn pow(self, rhs: P) -> Dual<T>
[src]
fn pow(self, rhs: P) -> Dual<T>
Returns self
to the power rhs
. Read more
impl<T: Scalar> Inv for Dual<T> where
Self: One + Div<Output = Self>,
[src]
impl<T: Scalar> Inv for Dual<T> where
Self: One + Div<Output = Self>,
type Output = Dual<T>
The result after applying the operator.
fn inv(self) -> Dual<T>
[src]
fn inv(self) -> Dual<T>
Returns the multiplicative inverse of self
. Read more
impl<T: Scalar> Signed for Dual<T> where
T: Signed + PartialOrd,
[src]
impl<T: Scalar> Signed for Dual<T> where
T: Signed + PartialOrd,
fn abs(&self) -> Self
[src]
fn abs(&self) -> Self
Computes the absolute value. Read more
fn abs_sub(&self, rhs: &Self) -> Self
[src]
fn abs_sub(&self, rhs: &Self) -> Self
The positive difference of two numbers. Read more
fn signum(&self) -> Self
[src]
fn signum(&self) -> Self
Returns the sign of the number. Read more
fn is_positive(&self) -> bool
[src]
fn is_positive(&self) -> bool
Returns true if the number is positive and false if the number is zero or negative.
fn is_negative(&self) -> bool
[src]
fn is_negative(&self) -> bool
Returns true if the number is negative and false if the number is zero or positive.
impl<T: Scalar + Unsigned> Unsigned for Dual<T> where
Self: Num,
[src]
impl<T: Scalar + Unsigned> Unsigned for Dual<T> where
Self: Num,
impl<T: Scalar + Num + Zero> Zero for Dual<T>
[src]
impl<T: Scalar + Num + Zero> Zero for Dual<T>
fn zero() -> Dual<T>
[src]
fn zero() -> Dual<T>
Returns the additive identity element of Self
, 0
. Read more
fn is_zero(&self) -> bool
[src]
fn is_zero(&self) -> bool
Returns true
if self
is equal to the additive identity.
impl<T: Scalar + Num + One> One for Dual<T>
[src]
impl<T: Scalar + Num + One> One for Dual<T>
fn one() -> Dual<T>
[src]
fn one() -> Dual<T>
Returns the multiplicative identity element of Self
, 1
. Read more
fn is_one(&self) -> bool where
Self: PartialEq,
[src]
fn is_one(&self) -> bool where
Self: PartialEq,
Returns true
if self
is equal to the multiplicative identity. Read more
impl<T: Scalar + Num> Num for Dual<T>
[src]
impl<T: Scalar + Num> Num for Dual<T>
type FromStrRadixErr = <T as Num>::FromStrRadixErr
fn from_str_radix(
str: &str,
radix: u32
) -> Result<Dual<T>, Self::FromStrRadixErr>
[src]
fn from_str_radix(
str: &str,
radix: u32
) -> Result<Dual<T>, Self::FromStrRadixErr>
Convert from a string and radix <= 36. Read more
impl<T: Scalar + Float> NumCast for Dual<T>
[src]
impl<T: Scalar + Float> NumCast for Dual<T>
fn from<N: ToPrimitive>(n: N) -> Option<Dual<T>>
[src]
fn from<N: ToPrimitive>(n: N) -> Option<Dual<T>>
Creates a number from another value that can be converted into a primitive via the ToPrimitive
trait. Read more
impl<T: Scalar + FloatConst + Zero> FloatConst for Dual<T>
[src]
impl<T: Scalar + FloatConst + Zero> FloatConst for Dual<T>
fn E() -> Dual<T>
[src]
fn E() -> Dual<T>
Return Euler’s number.
fn FRAC_1_PI() -> Dual<T>
[src]
fn FRAC_1_PI() -> Dual<T>
Return 1.0 / π
.
fn FRAC_1_SQRT_2() -> Dual<T>
[src]
fn FRAC_1_SQRT_2() -> Dual<T>
Return 1.0 / sqrt(2.0)
.
fn FRAC_2_PI() -> Dual<T>
[src]
fn FRAC_2_PI() -> Dual<T>
Return 2.0 / π
.
fn FRAC_2_SQRT_PI() -> Dual<T>
[src]
fn FRAC_2_SQRT_PI() -> Dual<T>
Return 2.0 / sqrt(π)
.
fn FRAC_PI_2() -> Dual<T>
[src]
fn FRAC_PI_2() -> Dual<T>
Return π / 2.0
.
fn FRAC_PI_3() -> Dual<T>
[src]
fn FRAC_PI_3() -> Dual<T>
Return π / 3.0
.
fn FRAC_PI_4() -> Dual<T>
[src]
fn FRAC_PI_4() -> Dual<T>
Return π / 4.0
.
fn FRAC_PI_6() -> Dual<T>
[src]
fn FRAC_PI_6() -> Dual<T>
Return π / 6.0
.
fn FRAC_PI_8() -> Dual<T>
[src]
fn FRAC_PI_8() -> Dual<T>
Return π / 8.0
.
fn LN_10() -> Dual<T>
[src]
fn LN_10() -> Dual<T>
Return ln(10.0)
.
fn LN_2() -> Dual<T>
[src]
fn LN_2() -> Dual<T>
Return ln(2.0)
.
fn LOG10_E() -> Dual<T>
[src]
fn LOG10_E() -> Dual<T>
Return log10(e)
.
fn LOG2_E() -> Dual<T>
[src]
fn LOG2_E() -> Dual<T>
Return log2(e)
.
fn PI() -> Dual<T>
[src]
fn PI() -> Dual<T>
Return Archimedes’ constant.
fn SQRT_2() -> Dual<T>
[src]
fn SQRT_2() -> Dual<T>
Return sqrt(2.0)
.
impl<T: Scalar> Float for Dual<T> where
T: Float + Signed + FloatConst,
[src]
impl<T: Scalar> Float for Dual<T> where
T: Float + Signed + FloatConst,
fn nan() -> Self
[src]
fn nan() -> Self
Returns the NaN
value. Read more
fn infinity() -> Self
[src]
fn infinity() -> Self
Returns the infinite value. Read more
fn neg_infinity() -> Self
[src]
fn neg_infinity() -> Self
Returns the negative infinite value. Read more
fn neg_zero() -> Self
[src]
fn neg_zero() -> Self
Returns -0.0
. Read more
fn min_positive_value() -> Self
[src]
fn min_positive_value() -> Self
Returns the smallest positive, normalized value that this type can represent. Read more
fn epsilon() -> Self
[src]
fn epsilon() -> Self
Returns epsilon, a small positive value. Read more
fn min_value() -> Self
[src]
fn min_value() -> Self
Returns the smallest finite value that this type can represent. Read more
fn max_value() -> Self
[src]
fn max_value() -> Self
Returns the largest finite value that this type can represent. Read more
fn is_nan(self) -> bool
[src]
fn is_nan(self) -> bool
Returns true
if this value is NaN
and false otherwise. Read more
fn is_infinite(self) -> bool
[src]
fn is_infinite(self) -> bool
Returns true
if this value is positive infinity or negative infinity and false otherwise. Read more
fn is_finite(self) -> bool
[src]
fn is_finite(self) -> bool
Returns true
if this number is neither infinite nor NaN
. Read more
fn is_normal(self) -> bool
[src]
fn is_normal(self) -> bool
Returns true
if the number is neither zero, infinite, [subnormal][subnormal], or NaN
. Read more
fn is_sign_positive(self) -> bool
[src]
fn is_sign_positive(self) -> bool
Returns true
if self
is positive, including +0.0
, Float::infinity()
, and since Rust 1.20 also Float::nan()
. Read more
fn is_sign_negative(self) -> bool
[src]
fn is_sign_negative(self) -> bool
Returns true
if self
is negative, including -0.0
, Float::neg_infinity()
, and since Rust 1.20 also -Float::nan()
. Read more
fn classify(self) -> FpCategory
[src]
fn classify(self) -> FpCategory
Returns the floating point category of the number. If only one property is going to be tested, it is generally faster to use the specific predicate instead. Read more
fn floor(self) -> Self
[src]
fn floor(self) -> Self
Returns the largest integer less than or equal to a number. Read more
fn ceil(self) -> Self
[src]
fn ceil(self) -> Self
Returns the smallest integer greater than or equal to a number. Read more
fn round(self) -> Self
[src]
fn round(self) -> Self
Returns the nearest integer to a number. Round half-way cases away from 0.0
. Read more
fn trunc(self) -> Self
[src]
fn trunc(self) -> Self
Return the integer part of a number. Read more
fn fract(self) -> Self
[src]
fn fract(self) -> Self
Returns the fractional part of a number. Read more
fn signum(self) -> Self
[src]
fn signum(self) -> Self
Returns a number that represents the sign of self
. Read more
fn abs(self) -> Self
[src]
fn abs(self) -> Self
Computes the absolute value of self
. Returns Float::nan()
if the number is Float::nan()
. Read more
fn max(self, other: Self) -> Self
[src]
fn max(self, other: Self) -> Self
Returns the maximum of the two numbers. Read more
fn min(self, other: Self) -> Self
[src]
fn min(self, other: Self) -> Self
Returns the minimum of the two numbers. Read more
fn abs_sub(self, rhs: Self) -> Self
[src]
fn abs_sub(self, rhs: Self) -> Self
The positive difference of two numbers. Read more
fn mul_add(self, a: Self, b: Self) -> Self
[src]
fn mul_add(self, a: Self, b: Self) -> Self
Fused multiply-add. Computes (self * a) + b
with only one rounding error, yielding a more accurate result than an unfused multiply-add. Read more
fn recip(self) -> Self
[src]
fn recip(self) -> Self
Take the reciprocal (inverse) of a number, 1/x
. Read more
fn powi(self, n: i32) -> Self
[src]
fn powi(self, n: i32) -> Self
Raise a number to an integer power. Read more
fn powf(self, n: Self) -> Self
[src]
fn powf(self, n: Self) -> Self
Raise a number to a floating point power. Read more
fn exp(self) -> Self
[src]
fn exp(self) -> Self
Returns e^(self)
, (the exponential function). Read more
fn exp2(self) -> Self
[src]
fn exp2(self) -> Self
Returns 2^(self)
. Read more
fn ln(self) -> Self
[src]
fn ln(self) -> Self
Returns the natural logarithm of the number. Read more
fn log(self, base: Self) -> Self
[src]
fn log(self, base: Self) -> Self
Returns the logarithm of the number with respect to an arbitrary base. Read more
fn log2(self) -> Self
[src]
fn log2(self) -> Self
Returns the base 2 logarithm of the number. Read more
fn log10(self) -> Self
[src]
fn log10(self) -> Self
Returns the base 10 logarithm of the number. Read more
fn sqrt(self) -> Self
[src]
fn sqrt(self) -> Self
Take the square root of a number. Read more
fn cbrt(self) -> Self
[src]
fn cbrt(self) -> Self
Take the cubic root of a number. Read more
fn hypot(self, other: Self) -> Self
[src]
fn hypot(self, other: Self) -> Self
Calculate the length of the hypotenuse of a right-angle triangle given legs of length x
and y
. Read more
fn sin(self) -> Self
[src]
fn sin(self) -> Self
Computes the sine of a number (in radians). Read more
fn cos(self) -> Self
[src]
fn cos(self) -> Self
Computes the cosine of a number (in radians). Read more
fn tan(self) -> Self
[src]
fn tan(self) -> Self
Computes the tangent of a number (in radians). Read more
fn asin(self) -> Self
[src]
fn asin(self) -> Self
Computes the arcsine of a number. Return value is in radians in the range [-pi/2, pi/2] or NaN if the number is outside the range [-1, 1]. Read more
fn acos(self) -> Self
[src]
fn acos(self) -> Self
Computes the arccosine of a number. Return value is in radians in the range [0, pi] or NaN if the number is outside the range [-1, 1]. Read more
fn atan(self) -> Self
[src]
fn atan(self) -> Self
Computes the arctangent of a number. Return value is in radians in the range [-pi/2, pi/2]; Read more
fn atan2(self, other: Self) -> Self
[src]
fn atan2(self, other: Self) -> Self
Computes the four quadrant arctangent of self
(y
) and other
(x
). Read more
fn sin_cos(self) -> (Self, Self)
[src]
fn sin_cos(self) -> (Self, Self)
Simultaneously computes the sine and cosine of the number, x
. Returns (sin(x), cos(x))
. Read more
fn exp_m1(self) -> Self
[src]
fn exp_m1(self) -> Self
Returns e^(self) - 1
in a way that is accurate even if the number is close to zero. Read more
fn ln_1p(self) -> Self
[src]
fn ln_1p(self) -> Self
Returns ln(1+n)
(natural logarithm) more accurately than if the operations were performed separately. Read more
fn sinh(self) -> Self
[src]
fn sinh(self) -> Self
Hyperbolic sine function. Read more
fn cosh(self) -> Self
[src]
fn cosh(self) -> Self
Hyperbolic cosine function. Read more
fn tanh(self) -> Self
[src]
fn tanh(self) -> Self
Hyperbolic tangent function. Read more
fn asinh(self) -> Self
[src]
fn asinh(self) -> Self
Inverse hyperbolic sine function. Read more
fn acosh(self) -> Self
[src]
fn acosh(self) -> Self
Inverse hyperbolic cosine function. Read more
fn atanh(self) -> Self
[src]
fn atanh(self) -> Self
Inverse hyperbolic tangent function. Read more
fn integer_decode(self) -> (u64, i16, i8)
[src]
fn integer_decode(self) -> (u64, i16, i8)
Returns the mantissa, base 2 exponent, and sign as integers, respectively. The original number can be recovered by sign * mantissa * 2 ^ exponent
. Read more
fn to_degrees(self) -> Self
[src]
fn to_degrees(self) -> Self
Converts radians to degrees. Read more
fn to_radians(self) -> Self
[src]
fn to_radians(self) -> Self
Converts degrees to radians. Read more