Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Module for finding the greatest prime number that is less than or equal to a given number
Synopsis
Documentation
greatestPrimeNotGreaterThan :: Int -> Int Source #
Returns the greatest prime number that is not greater than the given number
Returns 1 if called with the number 1
Returns 0 if called with a number lower than 1
See RealDice.Generate.RawData for reasons for use in this package
Examples
>>>
greatestPrimeNotGreaterThan 10
7>>>
greatestPrimeNotGreaterThan 1024
1021>>>
greatestPrimeNotGreaterThan 1
1>>>
greatestPrimeNotGreaterThan 0
0>>>
greatestPrimeNotGreaterThan (-1024)
0