[DiscordArchive] Why 0x7F?
[DiscordArchive] Why 0x7F?
Archived author: Deleted User • Posted: 2018-11-10T22:00:35.300000+00:00
Original source
the last bit
Archived author: Skarn • Posted: 2018-11-10T22:00:56.702000+00:00
Original source
why are you shifting right though?
Archived author: Skarn • Posted: 2018-11-10T22:01:18.135000+00:00
Original source
I assumed that would leave the first bit
Archived author: Deleted User • Posted: 2018-11-10T22:01:39.681000+00:00
Original source
well, there are other possibilities of expressing a shift
Archived author: Deleted User • Posted: 2018-11-10T22:01:42.473000+00:00
Original source
shift left -> * 2
Archived author: Deleted User • Posted: 2018-11-10T22:01:45.168000+00:00
Original source
shift right -> / 2
Archived author: Deleted User • Posted: 2018-11-10T22:02:01.004000+00:00
Original source
so if you shift to the right you loose the lowest bit
Archived author: Deleted User • Posted: 2018-11-10T22:02:06.856000+00:00
Original source
if you shift to the left you loose the highest bit
Archived author: Deleted User • Posted: 2018-11-10T22:02:53.370000+00:00
Original source
so if you shift 7 bits to the right you loose the lowest 7 bits and all thats left is the highest bit
Archived author: Deleted User • Posted: 2018-11-10T22:06:08.614000+00:00
Original source
getting the lowest n bits could also be `value & ((1 << n) - 1)` or `value & ~(1 << n)`