why ushort alias casted to int?
crimaniak
crimaniak at gmail.com
Fri Dec 22 10:42:28 UTC 2017
On Friday, 22 December 2017 at 10:18:52 UTC, ketmar wrote:
> 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.
Hm, really. ok, I will use the explicit cast, but I don't like it.
More information about the Digitalmars-d-learn
mailing list