This problem boils down to this:
julia> (-10.0)^2.2
ERROR: DomainError:
in nan_dom_err at ./math.jl:134 [inlined]
in ^(::Float64, ::Float64) at ./math.jl:293
in eval(::Module, ::Any) at ./boot.jl:225
in macro expansion at ./REPL.jl:92 [inlined]
in (::Base.REPL.##1#2{Base.REPL.REPLBackend})()
bb has negative elements, and if you exponentiate these to a fractional power
you get a complex result. To get a complex result, one of the arguments needs
to be complex, e.g. try bb.^(2.1+0im)
(Automatically switching to a complex result for negative inputs would be
type-unstable and kill
Look at this code:
x = 0.1:100
m = 10.1
bb = x-m
display(typeof(x)) # FloatRange{Float64}
display(typeof(bb)) # FloatRange{Float64}
# x.^2.1 #correctly done
bb.^2.2 # error -> why ?
The last line throw this error:
LoadError: DomainError:
while loading In[13], in expression starting on line 6