@@ -9,7 +9,7 @@ import Base: ==, <, <=, -, +, *, /, ~, isapprox,
99 signed, unsigned, copysign, flipsign, signbit,
1010 length
1111
12- using Requires
12+ import Statistics # for _mean_promote
1313import Random: Random, AbstractRNG, SamplerType, rand!
1414
1515import 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)
557557Base. reduce_empty (:: typeof (Base. mul_prod), :: Type{F} ) where {F<: FixedPoint } = one (Treduce)
558558Base. reduce_first (:: typeof (Base. mul_prod), x:: FixedPoint ) = Treduce (x)
559559
560+ if isdefined (Statistics, :_mean_promote )
561+ Statistics. _mean_promote (x:: Real , y:: FixedPoint ) = Treduce (y)
562+ end
563+
560564"""
561565 sd, ad = scaledual(s::Number, a)
562566
@@ -625,20 +629,4 @@ if VERSION >= v"1.1" # work around https://github.com/JuliaLang/julia/issues/341
625629 _precompile_ ()
626630end
627631
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-
644632end # module
0 commit comments