When using Uint8 one has a good reason for that.

I have found that that arrays have a different promotion rule: 
Array{Int32}+Array{Int32} -> Array{Int32}

So this does not seem to be entirely consistant.

Am Mittwoch, 15. Januar 2014 09:43:23 UTC+1 schrieb Milan Bouchet-Valat:
>
> Le mercredi 15 janvier 2014 à 00:17 -0800, Tobias Knopp a écrit : 
> > @Stefan: Is there a good reason to promote Int32 operations to the 
> > native mashine type? Sorry, if this has already discussed in depth. 
> > But for me it feals wrong to automatically upcast integer operations. 
> > I think that the type should keep stable and that this is more 
> > important than overflow issues. 
> Yeah, that's hard to guess what to do by default. With Int32 preserving 
> the type when summing might be reasonable (though not always), but if 
> somebody uses e.g. Uint8 to save space when there are many observations 
> with small counts, the sum should really use a different type. 
>
> But maybe it would be better to preserve the type, and let people use an 
> accumulator of a different type if they need it. If they are using a non 
> standard integer length, they must now what they are doing. 
>
> Related to this discussion: 
> https://github.com/JuliaLang/julia/issues/5311 
>
>
> Regards 
>
>

Reply via email to