go/math/is_prime.go
- View this file on GitHub
- Last update: 2022-04-23 02:30:25+00:00
Depends on
Required by
Code
func isPrime(a int) bool {
for i := 2; a >= i*i; i++ {
if a%i == 0 {
return false
}
}
return true
}
func isPrime(a int) bool {
for i := 2; a >= i*i; i++ {
if a%i == 0 {
return false
}
}
return true
}