mirror of
https://github.com/TheAlgorithms/Python.git
synced 2024-11-23 21:11:08 +00:00
Fermat_little_theorem type annotation (#9794)
* Replacing the generator with numpy vector operations from lu_decomposition.
* Revert "Replacing the generator with numpy vector operations from lu_decomposition."
This reverts commit ad217c6616
.
* Added type annotation.
* Update fermat_little_theorem.py
Used other syntax.
* Update fermat_little_theorem.py
* Update maths/fermat_little_theorem.py
---------
Co-authored-by: Tianyi Zheng <tianyizheng02@gmail.com>
This commit is contained in:
parent
dffbe458c0
commit
0e3ea3fbab
|
@ -5,7 +5,7 @@
|
||||||
# Wikipedia reference: https://en.wikipedia.org/wiki/Fermat%27s_little_theorem
|
# Wikipedia reference: https://en.wikipedia.org/wiki/Fermat%27s_little_theorem
|
||||||
|
|
||||||
|
|
||||||
def binary_exponentiation(a, n, mod):
|
def binary_exponentiation(a: int, n: float, mod: int) -> int:
|
||||||
if n == 0:
|
if n == 0:
|
||||||
return 1
|
return 1
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user