diff options
| author | Tyge Løvset <[email protected]> | 2023-07-18 02:36:04 +0200 |
|---|---|---|
| committer | GitHub <[email protected]> | 2023-07-18 02:36:04 +0200 |
| commit | da70303c149b37dbf442e41038a00836132562ee (patch) | |
| tree | 06d795c66d6759e06de5f2d166215b461ac40d1d /misc/examples/gauss2.c | |
| parent | 071b41c0fe95cb3f9a72bbe0417d856e7989ca08 (diff) | |
| parent | 23eeedb3fc298602732f394adba6a43c876ca7d8 (diff) | |
| download | STC-modified-da70303c149b37dbf442e41038a00836132562ee.tar.gz STC-modified-da70303c149b37dbf442e41038a00836132562ee.zip | |
Merge branch 'dev43' into master
Diffstat (limited to 'misc/examples/gauss2.c')
| -rw-r--r-- | misc/examples/gauss2.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/misc/examples/gauss2.c b/misc/examples/gauss2.c index df709d03..1ab8ade5 100644 --- a/misc/examples/gauss2.c +++ b/misc/examples/gauss2.c @@ -1,20 +1,21 @@ #include <stdio.h> #include <time.h> -#include <stc/crand.h> +#define i_implement #include <stc/cstr.h> +#include <stc/crand.h> // Declare int -> int sorted map. #define i_key int #define i_val int #include <stc/csmap.h> -int main() +int main(void) { enum {N = 5000000}; uint64_t seed = (uint64_t)time(NULL); crand_t rng = crand_init(seed); - const double Mean = round(crand_f64(&rng)*98.f - 49.f), StdDev = crand_f64(&rng)*10.f + 1.f, Scale = 74.f; + const double Mean = round(crand_f64(&rng)*98.0 - 49.0), StdDev = crand_f64(&rng)*10.0 + 1.0, Scale = 74.0; printf("Demo of gaussian / normal distribution of %d random samples\n", N); printf("Mean %f, StdDev %f\n", Mean, StdDev); |
