This code is extracted using Reflector of System.Collection.HashHelper class (internal: not available for user) internal static bool IsPrime(int candidate) { if ((candidate & 1) == 0) { return (candidate == 2); } int num = (int)Math.Sqrt((double)candidate); for (int i = 3; i <= num; i += 2) { if ((candidate % i) == 0) { [...]
Filed under: Uncategorized | Tagged: C#, Tips | Leave a Comment »


