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
: Theleft_value
parameter represents the first value to be multiplied. It is of typeu128
, which means it is an unsigned 128-bit integer.right_value
: Theright_value
parameter represents the second value to be multiplied with theleft_value
parameter in thetry_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
.