You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
a = -1
a^1 mod 10 = 9
a^2 mod 10 = 1
a^3 mod 10 = 9
a^4 mod 10 = 1
a*a mod 10 = 1
Real Output:
a = -1
a^1 mod 10 = 9
a^2 mod 10 = 9
a^3 mod 10 = 9
a^4 mod 10 = 9
a*a mod 10 = 1
I don't know, if my understanding of modulo calculus is correct, but from all I know, I'd assume, that -1^2 == 1 and that a * a == a^2 regardless of the modulus.
The text was updated successfully, but these errors were encountered:
The following code calculates
a^i
fori
= 1,2,3,4:https://play.rust-lang.org/?version=stable&mode=debug&edition=2018&gist=7de58584f7dff3342bf0c8cce191bfb7
Expected Output:
Real Output:
I don't know, if my understanding of modulo calculus is correct, but from all I know, I'd assume, that
-1^2 == 1
and thata * a == a^2
regardless of the modulus.The text was updated successfully, but these errors were encountered: