Skip to content

CongruentMod ​

Whether a≡b(modm)a \equiv b \pmod m -- true exactly when m∣(a−b)m \mid (a - b).

✓ checked against that system · ! checked, with disagreements (hover a chip)FungrimCongruentMod✓Fungrim entry
CongruentMod(a, b, m) -> booleanexact for arbitrary-precision integers, past double precision
Typed signatures
TypePackageApplies
(integer, integer, integer) -> booleananalyticalways

Domain: Number theory

Examples

Basic #

5≡2(mod3)5 \equiv 2 \pmod 3 since 3∣(5−2)3 \mid (5-2)

live ↗
InCongruentMod(5,2,3)\mathrm{CongruentMod}(5, 2, 3)OutTrue\mathrm{True}
Scope #
live ↗
InCongruentMod(5,1,3)\mathrm{CongruentMod}(5, 1, 3)OutFalse\mathrm{False}

A value is always congruent to itself, mod anything

live ↗
InCongruentMod(7,7,5)\mathrm{CongruentMod}(7, 7, 5)OutTrue\mathrm{True}
live ↗
InCongruentMod(7,1,3)\mathrm{CongruentMod}(7, 1, 3)OutTrue\mathrm{True}

Exact for arbitrary-precision integers, past double precision

live ↗
InCongruentMod(12 345 678 901 234 567 891,2,7)\mathrm{CongruentMod}(12\,345\,678\,901\,234\,567\,891, 2, 7)OutTrue\mathrm{True}
live ↗
InCongruentMod(12 345 678 901 234 567 891,3,7)\mathrm{CongruentMod}(12\,345\,678\,901\,234\,567\,891, 3, 7)OutFalse\mathrm{False}
About
Examples6
CrosswalkFungrimFungrim entry ×7

See also: Mod, GCD