diff options
| author | tylov <[email protected]> | 2023-07-24 08:41:55 +0200 |
|---|---|---|
| committer | tylov <[email protected]> | 2023-07-24 08:41:55 +0200 |
| commit | 650b053f443f9132dadb6d1ca924c0b36849739f (patch) | |
| tree | 88011006f6d536cdb1ad1eca8073392ca80687cc /misc/examples/algorithms | |
| parent | d9464e7ddfa70860ca09d373d01dc1a6f7730271 (diff) | |
| download | STC-modified-650b053f443f9132dadb6d1ca924c0b36849739f.tar.gz STC-modified-650b053f443f9132dadb6d1ca924c0b36849739f.zip | |
Fix for: Merge branch 'master' into dev43
Diffstat (limited to 'misc/examples/algorithms')
| -rw-r--r-- | misc/examples/algorithms/random.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/misc/examples/algorithms/random.c b/misc/examples/algorithms/random.c index fd904b0f..9522c16d 100644 --- a/misc/examples/algorithms/random.c +++ b/misc/examples/algorithms/random.c @@ -4,7 +4,7 @@ int main(void) { - const int N = 10000000; + const long long N = 10000000; const uint64_t seed = (uint64_t)time(NULL), range = 1000000; crand_t rng = crand_init(seed); @@ -19,7 +19,7 @@ int main(void) } diff = clock() - before; printf("full range\t\t: %f secs, %lld, avg: %f\n", - (double)diff/CLOCKS_PER_SEC, N, (double)(sum/N)); + (double)diff/(double)CLOCKS_PER_SEC, N, (double)(sum/N)); crand_uniform_t dist1 = crand_uniform_init(0, range); rng = crand_init(seed); @@ -29,8 +29,8 @@ int main(void) sum += crand_uniform(&rng, &dist1); // unbiased } diff = clock() - before; - printf("unbiased 0-%" PRIu64 "\t: %f secs, %lld, avg: %f\n", - range, (double)diff/CLOCKS_PER_SEC, N, (double)(sum/N)); + printf("unbiased 0-%lld\t: %f secs, %lld, avg: %f\n", + (long long)range, (double)diff/CLOCKS_PER_SEC, N, (double)(sum/N)); sum = 0; rng = crand_init(seed); @@ -40,6 +40,6 @@ int main(void) } diff = clock() - before; printf("biased 0-%" PRIu64 " \t: %f secs, %lld, avg: %f\n", - range, (double)diff/CLOCKS_PER_SEC, N, (double)(sum/N)); + (long long)range, (double)diff/CLOCKS_PER_SEC, N, (double)(sum/N)); } |
