My biginteger realization with Boost library tests. Just a lab for my university
- Boolean arithmetic
- Basic arithmetic
- Class with overloaded operators
- Modular arithmetic
- Boost Test Library
- GCD (Euclid + Binary)
- LCM
- Interface (read/write)
make all
command compiles it depending on your system architecture (64-bit or 32-bit).
Executable is ./bin/bigint
.
Only testing at the moment.
To see available tests type
make available_tests
To test one of them just type
make test_testname
To see only errors (or nothing if there are no errors) type
make test_testname_errors
make test_time
./tests/bin/time 1 1000
Usage of time
:
- If you execute
time
without parameters, you can see available test numbers - First argument is the test number
- Second argument is the number of BigIntegers to generate and operate
- Third argument is timeout in seconds (positive integer). Default is 10
Use valgrind. For example:
valgrind --track-origins=yes --tool=memcheck --leak-check=full ./tests/bin/time 5 1 2>err.log
Flag -g
in g++
allows you to see the line of code
in which the memory leak could be fixed.