Search
 
SCRIPT & CODE EXAMPLE
 

CSHARP

isprime c#

public static bool IsPrime(int number)
{
    if (number <= 1) return false;
    if (number == 2) return true;
    if (number % 2 == 0) return false;

    var boundary = (int)Math.Floor(Math.Sqrt(number));

    for (int i = 3; i <= boundary; i+=2)
        if (number % i == 0)
            return false;

    return true;        
}
Comment

PREVIOUS NEXT
Code Example
Csharp :: get random number c# 
Csharp :: unity lookrotation lerp 
Csharp :: c# get wifi ip address 
Csharp :: mouselook script unity 
Csharp :: c# list all files in a directory and subdirectory 
Csharp :: c# get object property value by name 
Csharp :: how to split and get last index values in c# 
Csharp :: c# unity camera follow player horizontal axis 
Csharp :: c# map number range 
Csharp :: c# require administrator permissions 
Csharp :: how to maximize but show taskbar c# 
Csharp :: unity mouse disapear 
Csharp :: this site can’t be reachedlocalhost unexpectedly closed the connection. .net framework 
Csharp :: base64decode C# 
Csharp :: assign datasource to dropdownlist in c# 
Csharp :: close window from page xaml 
Csharp :: how to unset passwordchar in c# windows application 
Csharp :: countdown timer c# unity 
Csharp :: application server types in .net 
Csharp :: after each vue router 
Csharp :: how to draw over label C# 
Csharp :: How do I remove all non alphanumeric characters from a string? 
Csharp :: c#image to bytes 
Csharp :: binding command to event wpf 
Csharp :: canty obituary schenectady ny 
Csharp :: C# get enum value by DescriptionAttribute 
Csharp :: transform.rotate unity 
Csharp :: loop over all values in enum 
Csharp :: built in methods to order a list c# 
Csharp :: unity round to x decimals 
ADD CONTENT
Topic
Content
Source link
Name
1+3 =