Function try_mul

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

The try_mul function in Rust attempts to multiply two u128 values and returns the result as an Option<u128>, returning None if the multiplication overflows.

Arguments:

  • left_value: The left_value parameter represents the first value to be multiplied. It is of type u128, which means it is an unsigned 128-bit integer.
  • right_value: The right_value parameter represents the second value to be multiplied with the left_value parameter in the try_mul function.

Returns:

The function try_mul returns an Option<u128>. It returns Some(result_mut) if the multiplication of left_value and right_value does not overflow and the division of the result by left_value equals right_value. Otherwise, it returns None.