mardi 26 juillet 2016

Bitshifting with and without leading zero [duplicate]

This question already has an answer here:

I wonder why adding one or multiple leading zeros to an integer in Python leads to different results when using the bitshift-operators:

In:  10<<1
Out: 20

Adding a "0" in front of the integer:

In:  010<<1
Out: 16

Aucun commentaire:

Enregistrer un commentaire