Macro inari::interval

source Β·
macro_rules! interval {
    ($s:expr) => { ... };
    ($a:expr, $b:expr) => { ... };
}
Expand description

Creates an Interval from f64 bounds or from a bare interval literal.

There are two variants of the macro:

  • interval!(a, b)

    Creates an interval $[a, b]$. The condition $a ≀ b ∧ a < +∞ ∧ b > -∞$ must be held.

    a and b must be f64 values.

  • interval!(s)

    Creates an interval from a bare interval literal. s must be a string slice (&str).

The result is a Result<Interval>.

If the construction is invalid, an Err value with IntervalErrorKind::UndefinedOperation is returned. If it fails to determine whether the construction is valid or not, IntervalErrorKind::PossiblyUndefinedOperation is returned.

For creating a constant, the macro const_interval! should be preferred over this one.