Skip to content
/ LL Public

A simple Lucas-Lehmer primality test implementation for C++

License

Notifications You must be signed in to change notification settings

josemam/LL

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 

Repository files navigation

LL

Simple Lucas-Lehmer primality test implementations for C++ and Haskell

My GitHub profile was empty, so I decided to add this. Why not?

These snippets perform a Lucas-Lehmer primality test for a given exponent. The C++ version works using Henrik Vestermark's arbitrary precision package. The Haskell implementation is way faster. And more elegant.

How to compile:

  • C++: save ll.cpp and Henrik Vestermark's package iprecision.h and precisioncore.cpp (you may find them here) at the same directory, then run g++ -o [any name for your executable file] ll.cpp precisioncore.cpp.
  • Haskell: run ghc -o [any name for your executable file] ll.hs -O2 -optc-O2.

Of course, there are better LL implementations all over the Internet (e.g.: check out prime95 for an excellent working SW or the large software list they suggest for many source code examples), so you will probably not want to start anything from this. I just wanted to upload something.

Anyway, if you still feel like updating this, you are welcome. Maybe a FFT-based multiplication in order to square number faster?

About

A simple Lucas-Lehmer primality test implementation for C++

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published