Standard library / math/big
big.Int.Exp()
Computes integer exponentiation, optionally modulo |m|; negative modular exponent needs an inverse. Not a constant-time cryptographic primitive. Expected stdout: '1208925819614629174706176\n'.
Formal Syntax & Structure
go syntaxgo
func (z *Int) Exp(x, y, m *Int) *IntParameters & Attributes
| Name | Type | Description |
|---|---|---|
| x | *Int | First input operand (or sole input if unary). |
| y | *Int | Second input operand. |
| m | *Int | Input m; see the operation contract. |
Return Value
*Int
Computes integer exponentiation, optionally modulo |m|; negative modular exponent needs an inverse. Not a constant-time cryptographic primitive.
Working Example
Example Snippetgo
package main
import ( "fmt" "math/big")
func main() { fmt.Println(new(big.Int).Exp(big.NewInt(2), big.NewInt(80), nil))}