Probably not very important, but code coverage is giving slightly odd results on 1.0 (and 0.7) in comparison to 0.6. Does anyone know why? Consider
function foo(array::Vector{Float64})
v = 0.0
for i in 1:length(array)
if mod(i, 10) != 0
v += array[i]
else
v -= array[i]
end
end
return v
end
foo(fill(1.0, 10000))
The .cov file produced by julia --code-coverage=user
on 0.6 gives
- function foo(array::Vector{Float64})
1 v = 0.0
1 for i in 1:length(array)
10000 if mod(i, 10) != 0
9000 v += array[i]
- else
1000 v -= array[i]
- end
- end
1 return v
- end
-
- foo(fill(1.0, 10000))
-
as expected. But on 0.7/1.0 it gives
- function foo(array::Vector{Float64})
1 v = 0.0
1 for i in 1:length(array)
10000 if mod(i, 10) != 0
9000 v += array[i]
- else
20000 v -= array[i]
- end
- end
1 return v
- end
-
- foo(fill(1.0, 10000))
-
If the != is changed to ==, then the count for the if statement is correct (1000) but the count for the else statement is still 20000.