Re:R49081 Is Prime
by dspillett on Monday November 21, 2022 @07:20AM
(#33691736)
47.9KiB in fact, assuming we are using 8-bits to the byte.
[ Parent
| on HN ]
Where are you getting that?
log2((10^49081 - 1) / 9) / 8 / 1024 ≈ 19.9
About 20 KiB
Ah. For some reason my head was locked in binary, and even then I was forgetting to convert Kbit->KiB. My only excuse is a bad night's sleep…
Re:R49081 Is Prime
by LeifCarrotson on Monday November 21, 2022 @12:34PM
(#33695339)
Only if you're representing it as an ASCII or UTF-8 string with one byte per character, or if you're using binary-coded decimal with 8 bits instead of the typical 4 for each decimal digit.
256 (3 digits) in base 2 is one byte, 65,536 (5 digits) is two bytes, 16,777,216 (8 digits) is three bytes, 4,294,967,296 (10 digits) is four bytes, etc. Those aren't 3, 5, 8, and 10 bytes, they're 1, 2, 3, and 4.