why ushort alias casted to int?

ketmar ketmar at ketmar.no-ip.org
Fri Dec 22 10:18:52 UTC 2017


crimaniak wrote:

> Both operands are the same type, so as I understand casting to longest 
> type is not needed at all, and longest type here is ushort in any case. 
> What am I doing wrong?

it is hidden in specs: all types shorter than int are promoted to int 
before doing any math.


More information about the Digitalmars-d-learn mailing list