|
@@ -55,7 +55,7 @@ Import the dependency as a Grape.
|
|
|
})
|
|
})
|
|
|
|
|
|
|
|
println timeIt({
|
|
println timeIt({
|
|
|
- for(int i = 2; i < Math.sqrt(number); i++){
|
|
|
|
|
|
|
+ for(int i = 2; i <= Math.sqrt(number); i++){
|
|
|
if((number % i) == 0){
|
|
if((number % i) == 0){
|
|
|
return false
|
|
return false
|
|
|
}
|
|
}
|
|
@@ -66,4 +66,4 @@ Import the dependency as a Grape.
|
|
|
Produces:
|
|
Produces:
|
|
|
|
|
|
|
|
[returnValue:true, duration:0.000181163]
|
|
[returnValue:true, duration:0.000181163]
|
|
|
- [returnValue:true, duration:0.000164525]
|
|
|
|
|
|
|
+ [returnValue:true, duration:0.000164525]
|