You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Floating point exponentiation appears to work for all the types.
Integer exponentiation now appears to work for all tuples, although for a while it was also broken for 3-tuples. Integer exponentiation also seems to work for immutables of two floats, but not 3 or 4.
This regression first appeared with fa315c9. Discussion on that thread suggests that the problem may be in LLVM (which puts it beyond my capability to track down further).
Some test code:
function test(a,n,b)
an = a.^n
pf = an == b ? "pass" : "fail"
println("$a.^$n == $an; $pf")
end
.^(v::(Float64,Float64),n::Number) = (v[1].^n,v[2].^n)
.^(v::(Float64,Float64,Float64),n::Number) = (v[1].^n,v[2].^n,v[3].^n)
.^(v::(Float64,Float64,Float64,Float64),n::Number) = (v[1].^n,v[2].^n,v[3].^n,v[4].^n)
immutable V2
x :: Float64
y :: Float64
end
.^(v::V2, n::Number) = V2(v.x.^n,v.y.^n)
immutable V3
x :: Float64
y :: Float64
z :: Float64
end
.^(v::V3, n::Number) = V3(v.x.^n,v.y.^n,v.z.^n)
immutable V4
x :: Float64
y :: Float64
z :: Float64
w :: Float64
end
.^(v::V4, n::Number) = V4(v.x.^n,v.y.^n,v.z.^n,v.w.^n)
t2 = (1.0,2.0)
t22 = (1.0,4.0)
t3 = (1.0,2.0,3.0)
t32 = (1.0,4.0,9.0)
t4 = (1.0,2.0,3.0,4.0)
t42 = (1.0,4.0,9.0,16.0)
v2 = V2(1.0,2.0)
v22 = V2(1.0,4.0)
v3 = V3(1.0,2.0,3.0)
v32 = V3(1.0,4.0,9.0)
v4 = V4(1.0,2.0,3.0,4.0)
v42 = V4(1.0,4.0,9.0,16.0)
for case in [ (t2,t22), (t3,t32), (t4,t42), (v2,v22), (v3,v32), (v4,v42) ]
test(case[1],2.0,case[2])
test(case[1],2,case[2])
end
Floating point exponentiation appears to work for all the types.
Integer exponentiation now appears to work for all tuples, although for a while it was also broken for 3-tuples. Integer exponentiation also seems to work for immutables of two floats, but not 3 or 4.
This regression first appeared with fa315c9. Discussion on that thread suggests that the problem may be in LLVM (which puts it beyond my capability to track down further).
Some test code:
produces:
The text was updated successfully, but these errors were encountered: