2

I am working on some modulo arithmetic and I do not seem to understand why

$28^{-1} (mod59)= 19 (mod59)=55$ is and not $28^{-1} (mod59) = 0.0035 (mod59)$ ?

When I try to calculate this in Java it does give me 0.0035

Amzoti
  • 56,093

1 Answers1

4

In modular arithmetic, the multiplicative inverse is generally not defined as $x^{-1} = \frac{1}{x}$. It's instead generally defined as an integer such that $x\cdot x^{-1} \equiv 1 \mod{n}$.

For example, the multiplicative inverse of $3$ modulo $5$ would be $2$, because $3\cdot 2 = 6 \equiv 1 \mod 5$.

In your case, $19$ is the multiplicative inverse of $28$ modulo $59$ because $28\cdot19 = 532 \equiv 1 \mod 59$.

Yiyuan Lee
  • 14,435
  • Actually, most people would say that $x^{-1}$ and $1/x$ are the same thing, just symbols meaning "the multiplicative inverse of $x$". It is very common to see modular inverses written as fractions in the literature. – fkraiem Mar 09 '14 at 18:03