Files
meowc/examples/hello/src/main.c
T
milner d71c538eef feat(examples): add a hello project with a library and a consumer
Smallest project that exercises the whole pipeline: one static library and one
executable that links against it.
2022-06-26 15:32:31 +00:00

19 lines
440 B
C

#include "mathx.h"
#include <stdio.h>
#ifndef GREETING
#define GREETING "hello"
#endif
int main(void) {
double xs[] = {1.0, 2.0, 3.0, 4.0, 5.0};
size_t n = sizeof xs / sizeof xs[0];
printf("%s\n", GREETING);
printf(" dot %.3f\n", vec_dot(xs, xs, n));
printf(" norm %.3f\n", vec_norm(xs, n));
printf(" mean %.3f\n", stats_mean(xs, n));
printf(" stddev %.3f\n", stats_stddev(xs, n));
return 0;
}