Create ModularExponentiation.java
Add modular exponentiation in Java
- [x] I have read CONTRIBUTING.md.
- [x] This pull request is all my own work -- I have not plagiarized it.
- [x] All filenames are in PascalCase.
- [x] All functions and variable names follow Java naming conventions.
- [x] All new algorithms have a URL in their comments that points to Wikipedia or other similar explanations.
- [x] All new code is formatted with
clang-format -i --style=file path/to/your/file.java
Add tests and code if y (power) is 0, return 1
I think you also want to throw an exception for y < 0.
@lulunac27a please fix all of the errors from the CI and please have a look at my previous comment.
Fixed errors by formatting code and changing function name to modPow
This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contribution!
Please reopen this pull request once you have made the required changes. If you need help, feel free to ask in our Discord server or ping one of the maintainers here. Thank you for your contribution!