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
andb
must bef64
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.