This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Text; | |
namespace System.Text | |
{ | |
/// <summary> | |
/// This class was generated by a tool. For more information, visit | |
/// http://www.hardcodet.net/2010/03/silverlight-text-encoding-class-generator | |
/// </summary> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Sieve | |
{ | |
public static List<int> GetPrimeNumbers(int maxValue) | |
{ | |
List<int> primeNumbers = new List<int>(new int[] { 2, 3, 5 }); | |
for (var testValue = primeNumbers.Max() + 1; testValue <= maxValue; testValue++) | |
{ | |
int sqrtTestValue = (int)Math.Floor(Math.Sqrt(testValue)); | |
bool isPrime = true; |
NewerOlder