Para este texto em português, veja README.pt.adoc.
The purple-arithmetics library contains procedures for arithmetics with "long" nonnegative integers.
This is an educational project with the purpose of learning and sharing algorithmic mathematics.
This library is defined as a C++26 module in main/ixx.
References:
-
Donald E. Knuth, "The Art of Computer Programming", volume 2, "Seminumerical Algorithms", third edition, ISBN 0-201-89684-2
-
MMIXmasters, "MIX to MMIX Conversion", https://mmix.cs.hm.edu/mmixmasters/index.html#MIXtoMMIX
-
Peter Montgomery, Torbjörn Granlund, "Division by Invariant Integers using Multiplication", PLDI '94, DOI: 10.1145/178243.178249
-
Alexander Stepanov, Paul McJones, "Elements of Programming", Addison-Wesley, 2009, ISBN 978-0-321-63537-2
-
Niels Möller, Torbjörn Granlund, "Improved division by invariant integers", IEEE Transactions on Computers, Volume 60, Issue 2, February 2011, DOI: 10.1109/TC.2010.143
-
Alexander Stepanov, Daniel Rose, "From Mathematics to Generic Programming", Addison Wesley, 2015, ISBN 978-0-321-94204-3
Building the library requires these tools.
-
clang 20+
-
libstdc++ 14+
-
ninja 1.11+
-
cmake 3.30+
To build the library:
cmake --preset default
cmake --build --preset defaultTo test for quality, run the purple-arithmetics-test program.
cmake-build-default/test/purple-arithmetics-testThis is a standard Google Test program, supporting the usual command line options.
To test for performance, run the purple-arithmetics-bechmark program.
cmake-build-default/benchmark/purple-arithmetics-benchmarkThis is a standard Google Benchmark program, supporting the usual command line options.
Performance is compared against the GMP library.