bugfix
This commit is contained in:
parent
cd3249c51f
commit
19026753e6
@ -17,14 +17,14 @@ func handler(w http.ResponseWriter, r *http.Request) {
|
|||||||
}
|
}
|
||||||
log.Print("Checking if %s is prime", target)
|
log.Print("Checking if %s is prime", target)
|
||||||
if num <= 1 {
|
if num <= 1 {
|
||||||
fmt.Sprintf("%d is not prime", num), nil
|
fmt.Sprintf("%d is not prime", num)
|
||||||
}
|
}
|
||||||
for i := 2; i <= int(math.Floor(float64(num)/2)); i++ {
|
for i := 2; i <= int(math.Floor(float64(num)/2)); i++ {
|
||||||
if num%i == 0 {
|
if num%i == 0 {
|
||||||
fmt.Sprintf("%d is not prime", num), nil
|
fmt.Sprintf("%d is not prime", num)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
fmt.Sprintf("%d is prime", num), nil
|
fmt.Sprintf("%d is prime", num)
|
||||||
}
|
}
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
|
Loading…
Reference in New Issue
Block a user