summaryrefslogtreecommitdiffhomepage
path: root/misc/examples/prime.c
diff options
context:
space:
mode:
authorTyge Løvset <[email protected]>2023-03-28 19:29:05 +0200
committerTyge Løvset <[email protected]>2023-03-28 19:29:05 +0200
commit59d74d181e44dd05a8570b42fc6284745e225664 (patch)
treeb693ec9f5ef0d529fd2e6edbe3b53cf0f1eb8c2d /misc/examples/prime.c
parent26cd0a73422cdbcd4998170e179fa0f3ce48e9a5 (diff)
downloadSTC-modified-59d74d181e44dd05a8570b42fc6284745e225664.tar.gz
STC-modified-59d74d181e44dd05a8570b42fc6284745e225664.zip
Example changes. Added crand.h possible replacement for crandom.h
Diffstat (limited to 'misc/examples/prime.c')
-rw-r--r--misc/examples/prime.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/misc/examples/prime.c b/misc/examples/prime.c
index 9ffb2f53..34d64f10 100644
--- a/misc/examples/prime.c
+++ b/misc/examples/prime.c
@@ -42,9 +42,8 @@ int main(void)
puts("\n");
puts("Show the last 50 primes using a temporary crange generator:");
- crange R = crange_make(n - 1, 0, -2);
- c_forfilter (i, crange, R,
- cbits_test(&primes, *i.ref>>1) &&
+ c_forfilter (i, crange, crange_object(n - 1, 0, -2),
+ cbits_test(&primes, *i.ref/2) &&
c_flt_take(i, 50)
){
printf("%lld ", *i.ref);