Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function IsPrime($iValor)
- {
- $iCount = 4;
- if( ($iValor == 2) || ($iValor == 3) ) return true;
- if( !($iValor % 2) || !($iValor % 3) || !($iValor % 4) || ($iValor == 1)) return false;
- while(++$iCount <= sqrt($iValor))
- if( !($iValor % $iCount) && ($iValor != $iCount) ) return false;
- return true;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement