yesthattom: (Default)
[personal profile] yesthattom
In C, perl, Python and probably every modern computer language
1 << 16 - 1
looks like it should give the highest value an unsigned 16-bit int can store, but it doesn't: That would be
(1 << 16) - 1
because without parens the “16-1” is done first, and you get “(1 << 15)".

So here's the nerdy part.

I searched various open source programs on the net until I found one that had "digits << digits - digits" until I found one. I then submitted a bug report to the author asking if he had intended "(digits << digits ) - digits. He had, and thanked me for the correction.

I had never used the software, nor did I even understand what it did.
This account has disabled anonymous posting.
If you don't have an account you can create one now.
HTML doesn't work in the subject.
More info about formatting

December 2015

S M T W T F S
  12345
6789 101112
13141516171819
202122 23242526
2728293031  

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags
Page generated Jun. 30th, 2025 11:01 am
Powered by Dreamwidth Studios