Function try_div

Source
pub fn try_div(left_value: u128, right_value: u128) -> Option<u128>
Expand description

The try_div function in Rust attempts to perform division on two u128 values and returns the result as an Option<u128>, or None if the division is not exact.

Arguments:

  • left_value: The left_value parameter represents the dividend in a division operation. It is the number that is being divided.
  • right_value: The right_value parameter in the try_div function represents the divisor in a division operation. It is the value by which the left_value (dividend) will be divided. If right_value is equal to 0, the function will return None since division

Returns:

The function try_div returns an Option<u128>. It returns Some(result_mut) if the division is successful and the result is correct, otherwise it returns None if the right_value is 0 or if the division result is incorrect.