Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Arithmetic operators convert Int32 to Int64 #7825

Closed
danluu opened this issue Aug 3, 2014 · 4 comments
Closed

Arithmetic operators convert Int32 to Int64 #7825

danluu opened this issue Aug 3, 2014 · 4 comments

Comments

@danluu
Copy link
Contributor

danluu commented Aug 3, 2014

julia> i32 = int32(1)
1

julia> x = i32 + i32
2

julia> typeof(x)
Int64

I'd expect x to be Int32 here, and the fact that it's not means that I need to wrap all sorts of stuff in int32; that's probably not even sufficient if I don't break down every expression so that it only has one operator, otherwise I'll still have internal Int64s floating around in something like int32((a + b) * c).

@astrieanna mentioned that there's probably already a bug on this, but neither of us could find it.

@ivarne
Copy link
Member

ivarne commented Aug 3, 2014

There has been lots of discussion on this, and lots of us think the behaviour is wrong (and that it should be changed). It is at least mentioned in the FAQ, but not as prominent as it should.

@IainNZ
Copy link
Member

IainNZ commented Aug 3, 2014

i believe this is changing in 0.4 release, but I could be wrong.

@JeffBezanson
Copy link
Member

At least these: #1078 #3759 #5413 #5806 #7338 #6211
Then I got tired of searching.

@StefanKarpinski
Copy link
Member

Yes, we're going to change this in the next major release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants