@@ -9,7 +9,7 @@ import Base: ==, <, <=, -, +, *, /, ~, isapprox,
9
9
signed, unsigned, copysign, flipsign, signbit,
10
10
length
11
11
12
- using Requires
12
+ import Statistics # for _mean_promote
13
13
import Random: Random, AbstractRNG, SamplerType, rand!
14
14
15
15
import Base. Checked: checked_neg, checked_abs, checked_add, checked_sub, checked_mul,
@@ -557,6 +557,10 @@ Base.mul_prod(x::FixedPoint, y::FixedPoint) = Treduce(x) * Treduce(y)
557
557
Base. reduce_empty (:: typeof (Base. mul_prod), :: Type{F} ) where {F<: FixedPoint } = one (Treduce)
558
558
Base. reduce_first (:: typeof (Base. mul_prod), x:: FixedPoint ) = Treduce (x)
559
559
560
+ if isdefined (Statistics, :_mean_promote )
561
+ Statistics. _mean_promote (x:: Real , y:: FixedPoint ) = Treduce (y)
562
+ end
563
+
560
564
"""
561
565
sd, ad = scaledual(s::Number, a)
562
566
@@ -625,20 +629,4 @@ if VERSION >= v"1.1" # work around https://github.com/JuliaLang/julia/issues/341
625
629
_precompile_ ()
626
630
end
627
631
628
- @static if VERSION >= v " 1.9.0-DEV.873"
629
- function __init__ ()
630
- # Statistics and SparseArrays are moved out from sysimage
631
- # https://github.com/JuliaLang/julia/pull/44247#issuecomment-1172847231
632
- @require Statistics= " 10745b16-79ce-11e8-11f9-7d13ad32a3b2" begin
633
- Statistics. _mean_promote (x:: Real , y:: FixedPoint ) = Treduce (y)
634
- end
635
- end
636
- else
637
- import Statistics
638
- if isdefined (Statistics, :_mean_promote )
639
- # https://github.com/JuliaMath/FixedPointNumbers.jl/pull/183
640
- Statistics. _mean_promote (x:: Real , y:: FixedPoint ) = Treduce (y)
641
- end
642
- end
643
-
644
632
end # module
0 commit comments