4 ms·
I once implemented factorial in a for-fun from-scratch BigNum library (with techniques to speed it up such as collecting prime factors together and multiplying
by Aardwolf 2y ago
I once implemented factorial in a for-fun from-scratch BigNum library (with techniques to speed it up such as collecting prime factors together and multiplying in the order from smallest to largest), and I noticed that computing the factorial of a number like 100000 was faster, than converting the result to decimal for displaying the result
So avoiding that conversion can be a use case for using base 10 directly. But there are other use cases where you want it to be binary, the base conversion problem will always be there (unless humanity collectively decides to abandon base 10 and move on to base 16)
- JonChesterfield 2y agoBignum tends to work in base word-size or word-size/2 depending on how good your arch is at overflowing arithmetic. Except for PHP iirc which does actually use base 10 represented in strings.