Keyboard shortcuts

Press or to navigate between chapters

Press ? to show this help

Press Esc to hide this help

equality_mod

Checks if two u256 values are congruent modulo a given modulus

This function computes whether a ≡ b (mod modulo) by comparing their remainders when divided by the modulus. Two numbers are congruent modulo m if they have the same remainder when divided by m.

Arguments

  • a - The first u256 value to compare
  • b - The second u256 value to compare
  • modulo - The modulus for the congruence test

Returns

  • bool - true if a ≡ b (mod modulo), false otherwise

Fully qualified path: alexandria_math::mod_arithmetics::equality_mod

pub fn equality_mod(a: u256, b: u256, modulo: u256) -> bool