[][src]Struct uncertainty::unc::Unc

pub struct Unc;

A fieldless struct only used to instantiate AbUnc and RelUnc values.

Methods

impl Unc[src]

pub fn ab(val: f64, unc: f64) -> AbUnc[src]

Create an absolute uncertainty. The first parameter is the base value, and the second parameter is the absolute uncertainty in that value.

Examples

use uncertainty::*;

let u: AbUnc = Unc::ab(10.0, 1.0);
assert_eq!(u.val(), 10.0);
assert_eq!(u.unc(), 1.0);

pub fn rel(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 = Unc::rel(10.0, 0.1);
assert_eq!(u.val(), 10.0);
assert_eq!(u.unc(), 0.1);

Auto Trait Implementations

impl Send for Unc

impl Unpin for Unc

impl Sync for Unc

impl UnwindSafe for Unc

impl RefUnwindSafe for Unc

Blanket Implementations

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

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

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

type Error = Infallible

The type returned in the event of a conversion error.

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

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

The type returned in the event of a conversion error.

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

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

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