evaluate_indices

Function evaluate_indices 

Source
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 an i64.
  • index2: the second index that has to be converted into an i64.

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