summaryrefslogtreecommitdiffhomepage
path: root/misc/examples/prime.c
diff options
context:
space:
mode:
Diffstat (limited to 'misc/examples/prime.c')
-rw-r--r--misc/examples/prime.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/misc/examples/prime.c b/misc/examples/prime.c
index 287fb69b..41d637b8 100644
--- a/misc/examples/prime.c
+++ b/misc/examples/prime.c
@@ -28,7 +28,7 @@ int main(void)
printf("computing prime numbers up to %" c_ZU "\n", n);
clock_t t1 = clock();
- c_with (cbits primes = sieveOfEratosthenes(n + 1), cbits_drop(&primes)) {
+ c_WITH (cbits primes = sieveOfEratosthenes(n + 1), cbits_drop(&primes)) {
puts("done");
size_t np = cbits_count(&primes);
clock_t t2 = clock();
@@ -36,14 +36,14 @@ int main(void)
printf("number of primes: %" c_ZU ", time: %f\n", np, (t2 - t1) / (float)CLOCKS_PER_SEC);
puts("Show all the primes in the range [2, 1000):");
printf("2");
- c_forrange (i, 3, 1000, 2)
+ c_FORRANGE (i, 3, 1000, 2)
if (cbits_test(&primes, i>>1)) printf(" %lld", i);
puts("");
puts("Show the last 50 primes using a temporary crange generator:");
- c_forfilter (i, crange, crange_literal(n - 1, 0, -2)
+ c_FORFILTER (i, crange, crange_literal(n - 1, 0, -2)
, cbits_test(&primes, *i.ref>>1)
- , c_flt_take(i, 50)) {
+ , c_FLT_TAKE(i, 50)) {
printf("%lld ", *i.ref);
if (i.count % 10 == 0) puts("");
}