Hello, i am getting this behavior:
julia> a = 1.5 + 3//4im
1.5 - 0.75im
What I expected was:
julia> a = 1.5 + 3//4im
1.5 + 0.75im
Can any one tell me why?
Hello, i am getting this behavior:
julia> a = 1.5 + 3//4im
1.5 - 0.75im
What I expected was:
julia> a = 1.5 + 3//4im
1.5 + 0.75im
Can any one tell me why?
try
julia> a = 1.5 + (3//4)im
Multiplication by juxtaposition has higher precedence than //, so what youβre actually computing is 3//(4im). You can see how an expression is lowered for example with:
julia> Meta.@lower 3//4im
:($(Expr(:thunk, CodeInfo(
1 β %1 = 4im
β %2 = 3 // %1
βββ return %2
))))
And by /, it turns out. So you can write this, which is nice to know!
julia> 1/2Ο == 1/(2Ο)
true
Also:
julia> 1/2*Ο == 0.5Ο
true
julia> 1/2big(Ο) == 1/(2*big(Ο))
true
Thank you. I can sleep in peace today ![]()