[][src]Macro chek::almost_zero

macro_rules! almost_zero {
    ($value:expr $(,)?) => { ... };
    ($value:expr, $($msg_args:tt)+) => { ... };
}

Panics if the provided value is not almost equal to zero.

Uses the almost crate. See the almost::zero documentation for more details.

A debug-only version is available as chek::debug_almost_zero!.

Optionally may take an additional message to display on failure, which is formatted using standard format syntax.

Example

chek::almost_zero!(0.00000001);
chek::almost_zero!(std::f32::EPSILON, "Should be almost zero!");