[−][src]Struct uncertainty::RelUnc
Methods
impl RelUnc
[src]
pub fn new(val: f64, unc: f64) -> RelUnc
[src]
Create a relative uncertainty. The first parameter is the base value, and the second parameter is the relative uncertainty in the value, expressed as a decimal fraction.
Examples
use uncertainty::*; let u: RelUnc = RelUnc::new(10.0, 0.1); assert_eq!(u.val(), 10.0); assert_eq!(u.unc(), 0.1);
pub fn powi(self, power: i32) -> RelUnc
[src]
Raise a relative uncertainty to an integer power.
Potential problems
Casts the i32 to an f64 in order to calculate the change in uncertainty.
Examples
let two = RelUnc::new(2.0, 0.01); let eight = two.powi(3); assert_abs_diff_eq!(eight.val(), 8.0); assert_abs_diff_eq!(eight.unc(), 0.03);
pub fn powf(self, power: f64) -> RelUnc
[src]
Raise a relative uncertainty to an floating power.
Examples
let two = RelUnc::new(2.0, 0.01); let eight = two.powf(3.0); assert_abs_diff_eq!(eight.val(), 8.0); assert_abs_diff_eq!(eight.unc(), 0.03);
Trait Implementations
impl Uncertainty for RelUnc
[src]
fn to_ab(self) -> AbUnc
[src]
fn to_rel(self) -> RelUnc
[src]
fn val(&self) -> f64
[src]
fn unc(&self) -> f64
[src]
fn min(&self) -> f64
[src]
Return the minimum possible value of the uncertainty. This is functionally the base value - the uncertainty value. Read more
fn max(&self) -> f64
[src]
Return the maximum possible value of the uncertainty. This is functionally the base value + the uncertainty value. Read more
fn overlap<T: Uncertainty>(&self, other: &T) -> bool
[src]
Given two uncertainty values, determine whether they overlap. This is done by comparing the minimums and maximums to see whether they intersect. Intersecting uncertainties are said to be equal or overlap. Read more
impl From<f64> for RelUnc
[src]
impl From<RelUnc> for AbUnc
[src]
impl From<AbUnc> for RelUnc
[src]
impl Clone for RelUnc
[src]
fn clone(&self) -> RelUnc
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl Copy for RelUnc
[src]
impl Display for RelUnc
[src]
impl Debug for RelUnc
[src]
impl Div<RelUnc> for RelUnc
[src]
type Output = RelUnc
The resulting type after applying the /
operator.
fn div(self, other: RelUnc) -> Self::Output
[src]
impl Div<f64> for RelUnc
[src]
type Output = RelUnc
The resulting type after applying the /
operator.
fn div(self, other: f64) -> Self::Output
[src]
impl Div<RelUnc> for f64
[src]
type Output = RelUnc
The resulting type after applying the /
operator.
fn div(self, other: RelUnc) -> Self::Output
[src]
impl Mul<RelUnc> for RelUnc
[src]
type Output = RelUnc
The resulting type after applying the *
operator.
fn mul(self, other: RelUnc) -> Self::Output
[src]
impl Mul<f64> for RelUnc
[src]
type Output = RelUnc
The resulting type after applying the *
operator.
fn mul(self, other: f64) -> Self::Output
[src]
impl Mul<RelUnc> for f64
[src]
Auto Trait Implementations
impl Send for RelUnc
impl Unpin for RelUnc
impl Sync for RelUnc
impl RefUnwindSafe for RelUnc
impl UnwindSafe for RelUnc
Blanket Implementations
impl<T> From<T> for T
[src]
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
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.
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>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,