Skip to content

pedrolamarao/arithmetic-cxx

Repository files navigation

purple-arithmetic

Para este texto em português, veja README.pt.adoc.

The purple-arithmetic 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 in a C++26 module.

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

  • Alexander Stepanov, Paul McJones, "Elements of Programming", Addison-Wesley, 2009, ISBN 978-0-321-63537-2

  • Alexander Stepanov, Daniel Rose, "From Mathematics to Generic Programming", Addison Wesley, 2015, ISBN 978-0-321-94204-3

  • 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

Building the library requires these tools.

  • clang 20+

  • ninja 1.11+

  • cmake 3.30+

To build the library:

cmake --preset default
cmake --build --preset default

To test for quality, run the purple-arithmetic-test program.

cmake-build-default/purple-arithmetic-test

This is a standard Google Test program, supporting the usual command line options.

To test for performance, run the purple-arithmetic-bechmark program.

cmake-build-default/purple-arithmetic-benchmark

This is a standard Google Benchmark program, supporting the usual command line options.

Performance is compared against the GMP library.

About

Routines for arithmetic in C++.

Topics

Resources

License

Stars

Watchers

Forks