3 ms·
> 0..256?? Is this still 8-bits bytes?? In Rust a..b means the range a <= x < b, so yes, that is an 8-bit byte.
by dancek 7y ago
> 0..256?? Is this still 8-bits bytes??
In Rust a..b means the range a <= x < b, so yes, that is an 8-bit byte.
- scoutt 7y agoAn 8-bit byte can hold 256 values, from 0 to 255, and cannot hold a value = 256, whatever the philosophy is.
- ChrisSD 7y agoRead what dancek said again. In Rust `a..b` means a <= x < b So 0..256 is 0 <= x < 256 That is "less than" 256. There's no equals (that would be `0..=256` in Rust).
- scoutt 7y agoOh my.... Well, I guess the author realized about the confusion in every other non-Rust programmer it generates (https://git.ralfj.de/web.git/commitdiff/13622f8642fc071bedf32dba3efbd50a5906032c https://git.ralfj.de/web.git/commitdiff/13622f8642fc071bedf3...).