kokke/tiny-bignum-c

performance vs GMP? negative number support?

timotheecour opened this issue · 2 comments

are there any links to performance comparisons against GMP?

is there any planned work to support negative integers?

links

see also ilia3101/Big-Integer-C#1

kokke commented

Hi @timotheecour and thanks for your interest in this project :)

are there any links to performance comparisons against GMP?

I've made no performance comparisons, and know of none others have done. I suspect this library is much slower than GMP in almost all cases.
GMP utilizes lots of optimizations and numerical analysis, this library has almost no optimizations and works rather naiively; the emphasis is on simple code and small footprint.

is there any planned work to support negative integers?

No plans for implementing negative numbers, but I don't think it would require much though. Without having thought about it much, I think it's mostly an issue of how you input/output the negative numbers, as the underlying math mostly works out-of-the-box on unsigned representation of a negative number. E.g. -1 represented as MAX (i.e. 0 - 1 becomes MAX because of underflow/wrapping).

See also this issue: #3

Did that make sense to you? I am having a hard time explaining my thoughts about this in writing at the moment...

kokke commented

Hi again @timotheecour

I will close this issue now, after seeing your thumbs-up emoji 👍 Feel free to reopen if you feel for it :)