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?
> > > > > 

Reply via email to