Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

But why convert it to binary? If you store the number as an array of digits the parsing process should be O(n).


That means every limb operation should be done modulo 10^k, which would be pretty expensive and only makes sense if you don't do much computation with them so the base conversion will dominate the computation.


Are you asking why computers store numbers in binary?


No. Many bignum libraries store numbers as sequences (or linked lists) of "digits", where each digit is an 8 to 256-bit binary number. Which is why I'm skeptical of lifthrasiir's claim that a bignum cannot be parsed in O(n) since it is analogous to initializing a list.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: