Dirty but easy-to-comprehend arbitrary multiprecision libraries. Beware: VERY dirty.
This was a project intended as an university laboratory, meant to make us understand the value of precision in numerical computations. It uses vectors as means to store numbers by its digits, and operates on them accordingly. I've implemented addition, subtraction, multiplication and division. Any contributions are welcome! I also know the code is extremely unefficient and dirty, but my objective was to accomplish it as fast as possible.
A list of the main features of the project:
Feature | Description |
---|---|
Addition | Overloaded operator + |
Subtraction | Overloaded operator - |
Multiplication | Overloaded operator * |
Division | Overloaded operator / |
I/O | Overloaded operators cin /cout |
Comparison | Overloaded operators < /> /== /!= |
Instructions for using the library:
- Read a number from input stream using
cin
- Create a new
triple
object using that input. - Operate with the
triple
s as needed.