We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 57ac0eb commit 90d8447Copy full SHA for 90d8447
src/generic.jl
@@ -2109,7 +2109,7 @@ NaN
2109
function normalize(a::AbstractArray, p::Real = 2)
2110
nrm = norm(a, p)
2111
if !isempty(a)
2112
- aa = copymutable_oftype(a, typeof(first(a)/nrm))
+ aa = copymutable_oftype(a, float(Base.promote_eltype(a, nrm)))
2113
return __normalize!(aa, nrm)
2114
else
2115
T = typeof(zero(eltype(a))/nrm)
0 commit comments