Trait noisy_float::FloatChecker[][src]

pub trait FloatChecker<F> {
    fn check(value: F) -> bool;
fn assert(value: F); }

Trait for checking whether a floating point number is valid.

The implementation defines its own criteria for what constitutes a valid value.

Required methods

fn check(value: F) -> bool[src]

Returns true if (and only if) the given floating point number is valid according to this checker’s criteria.

The only hard requirement is that NaN must be considered invalid for all implementations of FloatChecker.

fn assert(value: F)[src]

A function that may panic if the floating point number is invalid.

Should either call assert!(check(value), ...) or debug_assert!(check(value), ...).

Loading content...


impl<F: Float> FloatChecker<F> for FiniteChecker[src]

impl<F: Float> FloatChecker<F> for NumChecker[src]

Loading content...