Re: [julia-users] ^ operator cannot compute correctly on "modified" range

2016-06-03 Thread Stefan Karpinski
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})()

[julia-users] ^ operator cannot compute correctly on "modified" range

2016-06-03 Thread Steven G. Johnson
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

[julia-users] ^ operator cannot compute correctly on "modified" range

2016-06-03 Thread Technet
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