News for hackers. Stuff that matters.

minimize

Re:Optimizing a Bignum Library for Fun on Tuesday July 16, 2024 @04:12PM (#40979882)
> For maximum efficiency you'd avoid addc like hell, because it blocks internal precomputation, and use guarantees like he did, avoiding overflow better.

Whether that is the case depends on the CPU. I hit memory bandwidth limits before adc becomes a problem. But I concede that you have a valid point and that there are definitely cases where leaving sufficient space for carries is the better strategy.

Anyway, we can probably both agree that "% 1000000000" is not a great idea.

Re:Optimizing a Bignum Library for Fun on Tuesday July 16, 2024 @03:09PM (#40979333)
For maximum efficiency, you should work in binary instead of base 10. Handling carries becomes more straightforward with the right primitives, for example __builtin_addc with GCC: https://gcc.gnu.org/onlinedocs/gcc/Integer-Overflow-Builtins...

You can also implement it in C if you want a more portable solution: https://github.com/983/bigint/blob/ee0834c65a27d18fa628e6c52...

If you scroll around, you can also find my implementations for multiplication and such.

Re:My Steam Game Revenue Stats on Saturday July 24, 2021 @02:29AM (#27938917)
Not sure if it has been mentioned yet, but I think the main reason why this title failed is the title. Most people probably never heard of "yerba mate", so to them, the title sounds like some kind of weird mating simulator.

You can verify this by comparing the sales by country to the number of searches for the term "yerba mate" by country: https://trends.google.com/trends/explore?q=yerba%20mate The distributions are very similar.