pub fn evaluate_indices(
index1: impl TryInto<i64> + Display,
index2: impl TryInto<i64> + Display,
) -> Result<(i64, i64), MathError>Expand description
Converts index1 and index2 into i64 that must be greater than 0 and must fit into
an i64.
Parameters:
index1: the first index that has to be converted into ani64.index2: the second index that has to be converted into ani64.
Returns an i64 representation of index1 and index2 or an error if the
indices do not fulfill all conditions.
§Examples
use qfall_math::utils::index::evaluate_indices;
let (index1, index2) = evaluate_indices(u32::MAX, 3).unwrap();§Errors and Failures
- Returns a
MathErrorof typeOutOfBoundsif either the index is negative or it does not fit into ani64.