You are here: Symbol Reference > MtxExpr Namespace > Classes > Vector Record > public > Vector.PrimeNumbers Method
MtxVec VCL
ContentsIndex
PreviousUpNext
Vector.PrimeNumbers Method

Fills vector with prime numbers, starting from 2 up to the value of n.

Pascal
function PrimeNumbers(n: integer): TVec;

Fills calling vector with prime numbers, starting from 2 up to the value of n. The memory for at least n elements is allocated. The maximum value of n is 1000. The prime numbers are fetched from a precreated table.

var a: Vector; begin a.PrimeNumbers(10); // a = [2,3,5,7] end;
Examples on GitHub
Copyright (c) 1999-2024 by Dew Research. All rights reserved.
What do you think about this topic? Send feedback!