Function chain_lib::calculator::try_mod

source ·
pub fn try_mod(left: u128, right: u128) -> Option<u128>
Expand description

This Rust function calculates the remainder of dividing one unsigned 128-bit integer by another, returning an Option with the result or None if the divisor is zero.

Arguments:

  • left: The left parameter is a 128-bit unsigned integer.
  • right: The right parameter is the divisor used in the modulo operation.

Returns:

The function try_mod returns an Option<u128>, which can either be Some(u128) if the right value is not zero, or None if the right value is zero.