2 Copyright (C) 2001-2003, Parrot Foundation.
7 examples/benchmarks/primes.c - Calculate prime numbers < 50000
11 % make examples/benchmarks/primes
12 % time examples/benchmarks/primes
16 Calculates all the prime numbers up to 50000 and prints out the number
17 of primes and the last one found.
31 =item C<int main(int argc, char *argv[])>
33 Main function to run the example.
40 main(int argc
, char *argv
[])
49 printf("N primes up to ");
62 if (I3
<= I4
) {goto LOOP
;}
67 if (I1
<= I2
) {goto REDO
;}
69 printf("last is: %d\n", I7
);
80 F<examples/benchmarks/primes.c>,
81 F<examples/benchmarks/primes.pasm>,
82 F<examples/benchmarks/primes.pl>,
83 F<examples/benchmarks/primes2_p.pasm>,
84 F<examples/benchmarks/primes2.c>,
85 F<examples/benchmarks/primes2.pir>,
86 F<examples/benchmarks/primes2.py>.
94 * c-file-style: "parrot"
96 * vim: expandtab shiftwidth=4: