[][src]Macro chek::debug_not_almost_zero_with_tolerance

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

Same as chek::not_almost_zero_with_tolerance! in debug builds or release builds where the -C debug-assertions was provided to the compiler. For all other builds, vanishes without a trace.

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

Example

// These are compiled to nothing if debug_assertions are off!
chek::debug_not_almost_zero_with_tolerance!(0.1, 0.01);
chek::debug_not_almost_zero_with_tolerance!(std::f32::EPSILON, std::f32::EPSILON / 2.0, "Should not be almost zero!");