Anonymous user
Primality by trial division: Difference between revisions
added a correct Go version, the previous didnt use sqrt to find max,and thus fails on alot of different input
(Nimrod -> Nim) |
(added a correct Go version, the previous didnt use sqrt to find max,and thus fails on alot of different input) |
||
Line 1,013:
=={{header|Go}}==
<lang go>func
max := uint64(math.Sqrt(float64(num)))
var i uint64
for i = 3; i <=
if num%i == 0 { return false }
}
}</lang>▼
}
=={{header|Groovy}}==
|