diff options
| author | Tyge Lovset <[email protected]> | 2023-02-01 08:38:45 +0100 |
|---|---|---|
| committer | Tyge Lovset <[email protected]> | 2023-02-01 08:38:45 +0100 |
| commit | 6ce6ef3307e52db5813d3c8d6a2cba52df06daf8 (patch) | |
| tree | 25af4be9fcd5e72778715b83ff312e157ca63b59 /misc/examples/birthday.c | |
| parent | b677a0c3950b8294ba6458e682a885351273ac08 (diff) | |
| download | STC-modified-6ce6ef3307e52db5813d3c8d6a2cba52df06daf8.tar.gz STC-modified-6ce6ef3307e52db5813d3c8d6a2cba52df06daf8.zip | |
Massive update from unsigned sizes and indices to signed.
Diffstat (limited to 'misc/examples/birthday.c')
| -rw-r--r-- | misc/examples/birthday.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/misc/examples/birthday.c b/misc/examples/birthday.c index be7f0457..fb887cd7 100644 --- a/misc/examples/birthday.c +++ b/misc/examples/birthday.c @@ -50,19 +50,19 @@ void test_distribution(void) uint64_t sum = 0; c_FOREACH (i, cmap_x, map) sum += i.ref->second; - sum /= map.size; + sum /= (uint64_t)map.size; c_FOREACH (i, cmap_x, map) { printf("%4" PRIu32 ": %" PRIu64 " - %" PRIu64 ": %11.8f\n", i.ref->first, i.ref->second, sum, - (1 - (double)i.ref->second / sum)); + (1.0 - (double)i.ref->second / (double)sum)); } } } int main() { - seed = time(NULL); + seed = (uint64_t)time(NULL); test_distribution(); test_repeats(); } |
