Spec on casting to integer with smaller range than value

Patrick Schluter Patrick.Schluter at bbox.fr
Sun Mar 29 10:02:06 UTC 2020


On Saturday, 28 March 2020 at 19:11:04 UTC, Johan wrote:
> On Saturday, 28 March 2020 at 15:23:19 UTC, Stefan Koch wrote:
>>
>> cast (ubyte)x is the same as = ((cast(uint)x) & 0xff)
>
> Where does the spec say that?
>
It's a consequence of the int promotion rule D adheres to.




More information about the Digitalmars-d mailing list