Macro inari::interval [−][src]
macro_rules! interval { ($s:expr) => { ... }; ($s:expr, exact) => { ... }; ($a:expr, $b:expr) => { ... }; }
Expand description
Creates an Interval
from f64
bounds or from a bare interval literal.
In case of a failure, it returns a Result<Interval>
instead of an Interval
.
If the construction is invalid,
an Err
with IntervalErrorKind::UndefinedOperation
is returned.
If it cannot determine whether the construction is valid or not,
IntervalErrorKind::PossiblyUndefinedOperation
is returned.
In both cases, the error contains the empty interval as a reasonable fallback value.
-
interval!(a, b)
Creates an interval $[a, b]$, where
a
andb
aref64
values.The conditions $a β€ b$, $a < +β$ and $b > -β$ must be held.
-
interval!(s)
Creates an interval from a bare interval literal.
s
must be a string slice (&str
). -
interval!(s, exact)
Creates an interval $π$ from the bare interval literal obtained by
format!("{:x}", x)
.s
must be a string slice (&str
).
For creating a constant, the macro const_interval!
should be preferred over this one.