Comments (3)
@2catycm This project is still in development and is not the most performant big integer library right now, especially compared to GMP which includes optimised assembly code for certain CPUs to extract the most performance.
I started it as an educational project, and so haven't been spending much time recently in maintaining it. I'll get back to improving things in the future when time permits. Until then I would recommend using GMP for serious use cases.
@perlun Yes, that's right. Changing the underlying representation from a string to a vector of integers will make things much faster as described in #24.
Apart from that, if someone can review the current multiplication implementation and suggest improvements it would be great!
from bigint.
See #24. I'm not sure if this would cause the time complexity to go down to O(n)
, but it would at least make things faster. @faheel, any thoughts from your end on this part?
from bigint.
What I ended up doing was to rewrite the BigInt
implementation to use libtommath
under the hood instead. The result is essentially a C++ wrapper (using the same public API as this lib) but using libttommath
as "backend" for the actual arithmetic operations. 🙂
I also ended up removing some functions which are no longer needed (for me), and changed the const std::string&
constructor to take a const char*
parameter instead, since my use case is a bit C-oriented) so the end result is not 100% compatible with this lib... but here's the link anyway, if anyone wants or needs something similar: perlang-org/perlang#425
from bigint.
Related Issues (20)
- Build fails in CLion 2017.3 HOT 1
- Add support for hexadecimal string in constructor HOT 9
- Should is_valid_number be able to handle negative numbers? HOT 2
- big_random might return a BigInt having a value with a leading 0 HOT 4
- Hex support HOT 1
- `big_random` function: mistake in description and better implementation suggestion HOT 3
- Improve README
- sqrt() always returns 1 HOT 4
- Improve the documentation related to development
- Support bitwise operation HOT 12
- a bug in DIV HOT 1
- MacOS Invalid token in expression during Make HOT 1
- Cannot compile on msvc2019, cmake, when trying to compile the release 0.50 HOT 1
- BigInt problem with hexdigit string HOT 1
- `log()` support
- Elaborate instructions on which files to #include for which functions/operators HOT 2
- Fix for MSVC?
- Invalid string access on modulo
- Some BigInt relational operators are not optimal
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from bigint.