You are viewing a single comment's thread. Return to all comments →
return false if num <= 1 return true if num == 2 || num == 3 return false if num.even? || num % 3 == 0 i = 5 while i * i <= num return false if num % i == 0 || num % (i + 2) == 0 i += 6 end true end ``
Seems like cookies are disabled on this browser, please enable them to open this website
Ruby - Methods - Introduction
You are viewing a single comment's thread. Return to all comments →