开发者

Usual Arithmetic Conversions

开发者 https://www.devze.com 2023-03-07 19:27 出处:网络
In here (msdn) I\'ve read about uac and everything is well and fine but last rule is bit disturbing. If I have two operands of type unsigned short will they b开发者_如何学Pythone converted to int not

In here (msdn) I've read about uac and everything is well and fine but last rule is bit disturbing. If I have two operands of type unsigned short will they b开发者_如何学Pythone converted to int not to unsiged int?


Thins might have something to do with chains of conversions. Although you don't need the int to be signed, it isn't harmful to use a signed int, either. SO in principle, both options should work.

By using the "normal" / signed int, you end up with a less restrictive case for further conversion.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号