macro_rules! num_mod {
($value:expr, $modulus:expr) => { ... };
}Expand description
num_mod is a convenience macro for creating a new NumberUnderMod instance.
§Arguments
- $value - The value of the number.
- $modulus - The modulus under which the number is considered.
§Examples
let num = num_mod!(10, 6); assert_eq!(num.value(), 4); This example creates a new NumberUnderMod with a value of 10 under modulus 6. The value is automatically reduced modulo 6, so the resulting NumberUnderMod has a value of 4.