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
a::Int64 = 5
b::Tuple{Int64, Int64} = (a, a)
Matrix{Int64}(b)
This code works, but if you replace all instances of Int64 with Int32 it does not work anymore.
ERROR: MethodError: Cannot `convert` an object of type Tuple{Int32,Int32} to an object of type Array{Int32,2}
This may have arisen from a call to the constructor Array{Int32,2}(...),
since type constructors fall back to convert methods.
But if you write it a bit different
a::Int64 = 5
Matrix{Int64}(a, a)
this will work with either Int32 or Int64.
I think my first sample should work with any integer-version.
The text was updated successfully, but these errors were encountered:
Julia v0.6
This code works, but if you replace all instances of Int64 with Int32 it does not work anymore.
But if you write it a bit different
this will work with either Int32 or Int64.
I think my first sample should work with any integer-version.
The text was updated successfully, but these errors were encountered: