You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Even though only positive integers make sense, ProbablyPrime accepts null and negative integers for the "number of Miller-Rabin rounds" parameter, and happily output true (i.e prime) when given n < 1.
package main
import "math/big"
func main() {
n := new(big.Int)
n.SetString("5041", 10) // 71 * 71
println(n.ProbablyPrime(0)) // true
}
Even though only positive integers make sense, ProbablyPrime accepts null and negative integers for the "number of Miller-Rabin rounds" parameter, and happily output
true
(i.e prime) when givenn < 1
.http://play.golang.org/p/vLwhlt3xsC
The text was updated successfully, but these errors were encountered: