isPrime(a)

Determines if a number is prime.


Syntax

o_isPrime(a)
a: scalar Integer - number to be tested
return: boolean - 0=not prime, 1=prime

Usage

Use whenever you would like to test a number to see if it is prime. A typical use would be to generate a set of primes for factorization.

Location

menu: veeos ==> Math ==> isPrime

library: mathLib

Example

o_isPrime(4) returns 0
o_isPrime(99961) returns 1

Notes

The algorithm used here is fairly brute-force but as such as about foolproof. While it is reasonably fast , it would not be appropriate to use for extremely large values.

Reference

Dependencies

Supported On

VEE 7.0+, all platforms

See Also


© 2015-2025. All Rights Reserved. Stan Bischof (stan@worldbadminton.com). Last updated 13 February 2024 08:50.