Skip to content

OlamideMustapha/prime

Repository files navigation

prime

Prime is a library that works with prime numbers

  • to check if a number is prime
  • to get the prime factor of a number

Essential problems

  • Listing out primes less than a specified number
  • Determining whether a given number is prime
  • Breaking a number into its prime factors

Issues

  • it works with integers within the bound of 10000

Description

prime takes an optional command line parameter of "-f", which determines the operation type. If "-f" then, it prompts you for an input and returns it prime factor(s), for any other parameter aside from "-f" prime will perform a primality check on user input, returning "It is prime!" if test is passed, otherwise "It is not a prime number".

Credit to: Get Programming With Haskell (https://www.manning.com/books/get-programming-with-haskell) by Will Kurt