Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.Sign up
GitHub is where the world builds software
Millions of developers and companies build, ship, and maintain their software on GitHub — the largest and most advanced development platform in the world.
Proposal: Interested in writing a modular exponentiation function in the Math package #39430
What version of Go are you using (
I'm not sure what you mean by "normal integers". Do you mean the built in type
You can always do x**y%m with
As Keith mentioned, the answer is to use math/big (and if you are doing crypto, use numbers larger than 64 bits, or better don't roll your own crypto).
As Keith also said, the math package is for floats, where modular exponentiation is not terribly useful.
Closing this issue (feature already exists).