Standard library / math/big
big.Jacobi()
Computes Jacobi symbol of x over odd integer y; even y panics. Returns -1, 0 or 1. Expected stdout: '1\n'.
Formal Syntax & Structure
go syntaxgo
func Jacobi(x, y *Int) intParameters & Attributes
| Name | Type | Description |
|---|---|---|
| x | *Int | First input operand (or sole input if unary). |
| y | *Int | Second input operand. |
Return Value
int
Computes Jacobi symbol of x over odd integer y; even y panics. Returns -1, 0 or 1.
Working Example
Example Snippetgo
package main
import ( "fmt" "math/big")
func main() { fmt.Println(big.Jacobi(big.NewInt(2), big.NewInt(7)))}