User Tools

Site Tools


notes:fall2024:projects:pnc0

This is an old revision of the document!


PNCX

algorithm: brute force / trial-by-division

variant: naive

START TIMEKEEPING
NUMBER: FROM 2 THROUGH UPPERBOUND:
    ISPRIME <- YES
    FACTOR: FROM 2 THROUGH NUMBER-1:
        SHOULD FACTOR DIVIDE EVENLY INTO NUMBER:
            ISPRIME <- NO
    PROCEED TO NEXT FACTOR
    SHOULD ISPRIME STILL BE YES:
        INCREMENT OUR PRIME TALLY
PROCEED TO NEXT NUMBER
STOP TIMEKEEPING

variant: break on composite (BOC)

variant: odds-only processing

variant: sqrt point

variant: break+odds

variant: break+sqrt

variant: break+odds+sqrt

timing

One way to calculate your runtime is by using the get_frame_counter() Vircon32 function. You will need to first store the start time (before you tally the prime numbers) and your end time (after you tally the prime numbers). Subtracting the start time from the end time will give you a value that you can use to find your runtime. The get_frame_counter() function obtains the current value of the frame counter. If you’d prefer, you could use get_time() or get_cycle_counter(). Just remember the runtime will need to be drawn in seconds with three decimal places for milliseconds.

wedge pnc0 runtimes

notes/fall2024/projects/pnc0.1727459579.txt.gz · Last modified: 2024/09/27 17:52 by jmerri10