Logo Search packages:      
Sourcecode: kbruch version File versions  Download package

int task::make_main_dn ( unsigned int  pmax_md,
unsigned short  max_product_length 
) [private]

find a denominator for the task

Definition at line 496 of file task.cpp.

References prim_factor_nr().

Referenced by create_task().

    int denominator;

    /* find a main denominator in the given limits by pmax_md and check
     * if the main denominator has enough prime factors */
    do {
        denominator = int ( ( (double (rand()) / RAND_MAX) * pmax_md) + 1);
    } while ( (pmax_md < 1) ||
              (prim_factor_nr (denominator) < max_product_length));

    return denominator;

Here is the call graph for this function:

Here is the caller graph for this function:

Generated by  Doxygen 1.6.0   Back to index