evaluate_index

Function evaluate_index 

Source
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 an i64.

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