https://github.com/dfithian/integer
A C++ library to do simple arithmetic on large natural numbers.
https://github.com/dfithian/integer
Last synced: 3 months ago
JSON representation
A C++ library to do simple arithmetic on large natural numbers.
- Host: GitHub
- URL: https://github.com/dfithian/integer
- Owner: dfithian
- Created: 2014-10-06T02:26:25.000Z (over 10 years ago)
- Default Branch: main
- Last Pushed: 2021-11-22T15:13:34.000Z (over 3 years ago)
- Last Synced: 2025-01-29T11:11:27.384Z (4 months ago)
- Language: C++
- Size: 1.35 MB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Integer
```cpp
#include
Integer myInteger = Integer("1234556709159591230592856");
myInteger *= 2; //2469113418319182461185712
myInteger /= 2; //1234556709159591230592856
myInteger += 1; //1234556709159591230592857
myInteger--; //1234556709159591230592856
```This repository contains the Integer class.
This class is a utility for doing arithmetic on large integers without strict precision limits.
It implements the C++ std::vector class so any limits on precision are those that apply to this class.From [cplusplus.com](http://www.cplusplus.com/reference/vector/vector/max_size/) reference:
>**Returns the maximum number of elements that the vector can hold.**
>**This is the maximum potential size the container can reach due to known system or library implementation limitations,**
>**but the container is by no means guaranteed to be able to reach that size:**
>**it can still fail to allocate storage at any point before that size is reached.**