Skip to content
C++ arbitrary precision implementation of Euler's Totient Function
Branch: master
Clone or download
Latest commit 4328ba8 Jan 25, 2018

Arbitrary precision Euler's Totient in C++

This is a very fast implementation of Euler's Totient Function using C++, GMP, and Primesieve. Arbitrary precision functionality is still on the works, it's tricky to implement and buffer overflows are a constant nuisance . This drinks heavily from clarsen's design, but aims to improve it for the particular purpose of arbitrary precision.



Simply #include "totient.hpp" in your code.


  • Use GMP instead of cpp_int
  • Better usage documentation 🕓
  • Clean up auxiliary test libraries
  • Use Baillie-PSW for primality instead of Miller-Rabin 🕓
  • Generate primes using multithreading
  • Re-write prime generator to use arbitrary precision

- Done, 🕓 - On the works, - To do

You can’t perform that action at this time.