Skip to content

Commit 37b8ba2

Browse files
authored
import mean from Statistics (#454)
1 parent 1b99b91 commit 37b8ba2

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

src/StaticArrays.jl

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,15 @@ import Base: @_inline_meta, @_propagate_inbounds_meta, @_pure_meta, @propagate_i
77
import Base: getindex, setindex!, size, similar, vec, show, length, convert, promote_op,
88
promote_rule, map, map!, reduce, reducedim, mapreducedim, mapreduce, broadcast,
99
broadcast!, conj, hcat, vcat, ones, zeros, one, reshape, fill, fill!, inv,
10-
iszero, sum, prod, count, any, all, minimum, maximum, extrema, mean,
10+
iszero, sum, prod, count, any, all, minimum, maximum, extrema,
1111
copy, read, read!, write
1212

13+
if VERSION >= v"0.7.0-beta.85"
14+
import Statistics: mean
15+
else
16+
import Base: mean
17+
end
18+
1319
using Random
1420
import Random: rand, randn, randexp, rand!, randn!, randexp!
1521
using Core.Compiler: return_type

test/mapreduce.jl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
using StaticArrays, Test
2+
if VERSION >= v"0.7.0-beta.85"
3+
import Statistics: mean
4+
end
25

36
@testset "Map, reduce, mapreduce, broadcast" begin
47
@testset "map and map!" begin

0 commit comments

Comments
 (0)