Table of Contents

IsPrime Method

Definition

Namespace
Cuemon.Extensions
Assemblies
Cuemon.Extensions.Core.dll
Source
src/Cuemon.Extensions.Core/IntegerExtensions.cs

IsPrime(int)

Determines whether the specified value is a prime number.

public static bool IsPrime(this int value)

Parameters

value int

The positive integer to determine whether is a prime number.

Returns

bool

true if the specified value is a prime number; otherwise, false.

Exceptions

ArgumentException

value has a value smaller than 0.