@@ -31,7 +31,15 @@ mul!(C::AbstractArray, X::AbstractArray, s::Number) = generic_mul!(C, s, X)
3131"""
3232 rmul!(A::AbstractArray, b::Number)
3333
34- Scale an array `A` by a scalar `b` overwriting `A` in-place.
34+ Scale an array `A` by a scalar `b` overwriting `A` in-place. Use
35+ [`lmul!`](@ref) to multiply scalar from left. The scaling operation
36+ respects the semantics of the multiplication [`*`](@ref) between an
37+ element of `A` and `b`. In particular, this also applies to
38+ multiplication involving non-finite numbers such as `NaN` and `±Inf`.
39+
40+ !!! compat "Julia 1.1"
41+ Prior to Julia 1.1, `NaN` and `±Inf` entries in `A` were treated
42+ inconsistently.
3543
3644# Examples
3745```jldoctest
@@ -44,6 +52,10 @@ julia> rmul!(A, 2)
44522×2 Array{Int64,2}:
4553 2 4
4654 6 8
55+
56+ julia> rmul!([NaN], 0.0)
57+ 1-element Array{Float64,1}:
58+ NaN
4759```
4860"""
4961function rmul! (X:: AbstractArray , s:: Number )
5769"""
5870 lmul!(a::Number, B::AbstractArray)
5971
60- Scale an array `B` by a scalar `a` overwriting `B` in-place.
72+ Scale an array `B` by a scalar `a` overwriting `B` in-place. Use
73+ [`rmul!`](@ref) to multiply scalar from right. The scaling operation
74+ respects the semantics of the multiplication [`*`](@ref) between `a`
75+ and an element of `B`. In particular, this also applies to
76+ multiplication involving non-finite numbers such as `NaN` and `±Inf`.
77+
78+ !!! compat "Julia 1.1"
79+ Prior to Julia 1.1, `NaN` and `±Inf` entries in `B` were treated
80+ inconsistently.
6181
6282# Examples
6383```jldoctest
@@ -70,6 +90,10 @@ julia> lmul!(2, B)
70902×2 Array{Int64,2}:
7191 2 4
7292 6 8
93+
94+ julia> lmul!(0.0, [Inf])
95+ 1-element Array{Float64,1}:
96+ NaN
7397```
7498"""
7599function lmul! (s:: Number , X:: AbstractArray )
0 commit comments