https://github.com/allemanfredi/eosio-biginteger
BigInteger implementation for EOSIO.cdt v1.6
https://github.com/allemanfredi/eosio-biginteger
blockchain cpp eosio eosio-biginteger
Last synced: over 1 year ago
JSON representation
BigInteger implementation for EOSIO.cdt v1.6
- Host: GitHub
- URL: https://github.com/allemanfredi/eosio-biginteger
- Owner: allemanfredi
- Created: 2019-07-25T07:32:36.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2019-07-26T13:01:30.000Z (almost 7 years ago)
- Last Synced: 2025-02-05T19:12:40.372Z (over 1 year ago)
- Topics: blockchain, cpp, eosio, eosio-biginteger
- Language: C++
- Homepage:
- Size: 28.3 KB
- Stars: 0
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# eosio-biginteger
Refactoring of [this repo](https://github.com/playerone-id/biginteger-for-eosio) to be compatible with EOSIO.cdt v1.6.
## Original Author
Matt McCutchen ( [C++ Big Integer Library](https://mattmccutchen.net/bigint/) )
## Added Features
* __`addmod(a,b,c)`__ => (a + b) % c
* __`submod(a,b,c)`__ => (a - b) % c
* __`mulmod(a,b,c)`__ => (a * b) % c
* __`divmod(a,b,c)`__ => (a / b) % c = ((a mod c) * (b^(-1) mod c)) mod c
## Use
```c++
#include "BigIntegerLibrary.hpp"
#include
BigInteger a = 65536;
print("a * a * a * a * a * a * a * a: ", ( a * a * a * a * a * a * a * a ) );
```
## Build
```
eosio-cpp your_file_name.cpp eos_mem_wrapper.cpp BigInteger.cpp BigIntegerAlgorithms.cpp BigIntegerUtils.cpp BigUnsigned.cpp BigUnsignedInABase.cpp -o your_file_name.wasm
```