BigNum is a library to create and calculate numbers of arbitrary size and precision.
This is mostly a learning experiment for me and is not currently ready to be used for anything mission critical. The goal was to try and make my implementation of strtod more accurate as the exponent gets further from 0. I plan to port this to C and potentially other langauges in the future.
As this is a learning experiment for me, I tried to keep things (relatively) simple. Each operation is also not optimized and their implementations are mainly based on grade school math. Almost all operations also create new objects for the results instead of performing the operation in place, which could consume more memory but is easier to implement for now.
Each digit of BigInt is a base-256 number represented by a single byte. In the future, this could potentially be extrapolated to use base-4294967296 (32-bits per digit) or base-18446744073709551616 (64-bits per digit). For now it is easier to compare multiple bytes against native 32/64-bit numbers for testing.
(✅ Completed, ❌ To do)
- ✅
+
Addition - ✅
-
Subtraction - ✅
*
Multiplication - ❌
/
Division - ✅
>>
/<<
Bit shifting - ❌
==
/<
/>
Comparison - ❌ Exponents
- ❌ Roots
- ❌ Logorithms
- ❌
+
Addition - ❌
-
Subtraction - ❌
*
Multiplication - ❌
/
Division - ❌
>>
/<<
Bit shifting - ❌
==
/<
/>
Comparison - ❌ Exponents
- ❌ Roots
- ❌ Logorithms