Nevron Open Vision Documentation
Nevron.Nov Namespace / NMathF Class / IsPrimeNumber Method


In This Topic
    IsPrimeNumber Method (NMathF)
    In This Topic
    Checks whether the specified number is a prime number
    Syntax
    'Declaration
     
    
    Public Shared Function IsPrimeNumber( _
       ByVal num As System.Integer _
    ) As System.Boolean
    'Usage
     
    
    Dim num As System.Integer
    Dim value As System.Boolean
     
    value = NMathF.IsPrimeNumber(num)
    public static System.bool IsPrimeNumber( 
       System.int num
    )

    Parameters

    num
    Remarks
    A natural number (i.e. 1, 2, 3, 4, 5, 6, etc.) is a prime number, if it is greater than 1 and has exactly two divisors - 1 and the number itself. This implementation uses the Trial-Division prime number check method, which can be quite slow for large numbers.
    Requirements

    Target Platforms: Windows 11, Windows 10, Windows 7, Windows Server 2019, Windows Server 2016, Windows Server 2012 R2, Windows Server 2012, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later)

    See Also