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;
}
Also in C#:
- c# object to json string
- sum the digits in c#
- quaternion euler
- add row count devepxress report
- c# access session in class
- variables
- c# null conditional operator if statement
- switch statement
- unity custom update
- c# input integer
- covert char[] to string C#
- sending email using c#
- convert word files to plain text c#
- unity making homing missile
- unity line renderer position count
- download file from url asp net web api c#
- what type of variable is true or false in c#
- unity cancel invokerepeating
- how to redirect to extern page in .net core
- create object in c#
- 2d object look at object
- c# loop through array
- c# LCP