I will write up the issue and file it tonight. I am concerned that re-introducing automatic widening would have a deleterious effect on performance by taking away some type constancy in a calculation path. Instead of knowing that, say, Int16 would be returned from a+b, a and b each Int16, the return type would become Union(Int16,Int32). Does that carry performance implications?
Regards On Wednesday, August 5, 2015 at 10:05:05 AM UTC-4, Milan Bouchet-Valat wrote: > > Le mardi 04 août 2015 à 14:44 -0700, Jeffrey Sarnoff a écrit : > > Or, it may be that the docs are behind the design decisions now > > implemented. > > Either way, good of you to bring this to light. > Indeed, this behavior has been changed during the 0.4 development > cycle: operations on numbers now preserve the type when all operands > are of the same type. Thanks for raising it. Could you file an issue on > GitHub? You could even suggest a patch with a new formulation if you > feel like it. > > Regards > > > On Tuesday, August 4, 2015 at 12:26:46 PM UTC-4, Sisyphuss wrote: > > > @Jeffrey, I don't quite get your idea. You agree with me? > > > > > > From your example, the document has claimed something it hasn't > > > done? > > > > > > > > > > > > On Tuesday, August 4, 2015 at 5:34:51 AM UTC+2, Jeffrey Sarnoff > > > wrote: > > > > > > > > (cont.) > > > > after reading that, I did not expect this: > > > > > > > > > > ```julia > > > > > > > > > > > > > > julia> a=typemax(Int8)+typemax(Int8) > > > > > -2 > > > > > > > > > > julia> a=typemax(Int8)*typemax(Int8) > > > > > 1 > > > > > > > > > > julia> a=typemin(Int8)-typemax(Int8) > > > > > 1 > > > > > ``` > > > > > > > > > > > > > > > ``` > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > On Monday, August 3, 2015 at 7:42:03 PM UTC-4, Sisyphuss wrote: > > > > > > "integer addition... operands are promoted to Int or UInt > > > > > > from narrower integer types" (http://docs.julialang.org/en/l > > > > > > atest/manual/integers-and-floating-point-numbers/) > > > > > > > > > > > > "These catch-all rules first promote all operands to a common > > > > > > type " (http://docs.julialang.org/en/latest/manual/conversion > > > > > > -and-promotion/#man-conversion-and-promotion) > > > > > > > > > > > > `Int8` is definitely not a subclass of `Int`, do this two > > > > > > assertions contradict to each other? > > > > > > >