You are here: Symbol Reference > Dew Namespace > Dew.Math Namespace > Classes > TVec Class > TVec Methods > TVec.PrimeNumbers Method
Dew Math for .NET
ContentsIndexHome
PreviousUpNext
TVec.PrimeNumbers Method

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

Syntax
C#
Visual Basic
public TVec PrimeNumbers(int n);

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: TVec; begin CreateIt(a); try a.PrimeNumbers(10); // a = [2,3,5,7] finally FreeIt(a); end; end;
Copyright (c) 1999-2024 by Dew Research. All rights reserved.
What do you think about this topic? Send feedback!