TVec::PrimeNumbers Method

TVec *PrimeNumbers(int n);

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

#NameTypeDescription
1nint
Remarks:

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.

Examples
#include "MtxVec.h"
#include "Units.MtxVec.h"

using namespace Dew;
using namespace Dew::Math;
using namespace Dew::Math::Units::MtxVec;

void Example()
{
    TVec* a;

    CreateIt(a);
    a->PrimeNumbers(10); // a = [2,3,5,7]
    FreeIt(a);
}
Declared in Dew::Math::TVec · Dew.Math/MtxVec.h · Cross-compiler