Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

performance vs GMP? negative number support? #18

Closed
timotheecour opened this issue Oct 4, 2020 · 2 comments
Closed

performance vs GMP? negative number support? #18

timotheecour opened this issue Oct 4, 2020 · 2 comments

Comments

@timotheecour
Copy link

timotheecour commented Oct 4, 2020

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
Copy link
Owner

kokke commented Jan 5, 2021

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
Copy link
Owner

kokke commented Jan 7, 2021

Hi again @timotheecour

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

@kokke kokke closed this as completed Jan 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants