The following is a neat way to determine if a number is prime or not extending the Fixnum class.
Source: http://www.noulakaz.net/weblog/2007/03/18/a-regular-expression-to-check-for-prime-numbers/
↧