disable warning C5250: _BitScanReverse: intrinsic function not declared
[liba.git] / test / poly.h
blob81b5452de17a11e49e3e59806b20132770e5de78
1 #define MAIN_(x) A_CAST_2(x, _poly)
2 #include "test.h"
3 #include "a/poly.h"
5 static void print_(a_float const *a, a_size n)
7 putchar('{');
8 a_forenum(a_size, i, n)
10 printf(A_FLOAT_PRI("", "g"), a[i]);
11 if (i < n - 1) { putchar(','); }
13 putchar('}');
16 int MAIN(int argc, char *argv[]) // NOLINT(misc-definitions-in-headers)
18 (void)(argc);
19 (void)(argv);
20 a_float x = 2;
21 a_float x4[] = {A_FLOAT_C(1.0), A_FLOAT_C(2.0), A_FLOAT_C(3.0), A_FLOAT_C(4.0)};
22 print_(x4, 4);
23 printf("=" A_FLOAT_PRI("", "g") "\n", a_poly_eval(x4, 4, x));
24 a_poly_swap(x4, 4);
25 print_(x4, 4);
26 printf("=" A_FLOAT_PRI("", "g") "\n", a_poly_eval(x4, 4, x));
27 print_(x4, 4);
28 a_poly_swap(x4, 4);
29 printf("=" A_FLOAT_PRI("", "g") "\n", a_poly_evar(x4, 4, x));
30 print_(x4, 3);
31 printf("=" A_FLOAT_PRI("", "g") "\n", a_poly_eval(x4, 3, x));
32 a_poly_swap(x4, 3);
33 print_(x4, 3);
34 printf("=" A_FLOAT_PRI("", "g") "\n", a_poly_eval(x4, 3, x));
35 print_(x4, 3);
36 printf("=" A_FLOAT_PRI("", "g") "\n", a_poly_evar(x4, 3, x));
37 a_poly_swap(x4, 3);
38 return 0;