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