FFmpeg
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
mathops.c
Go to the documentation of this file.
1 #include "mathops.h"
2 
3 #ifdef TEST
4 
5 #include <stdlib.h>
6 
7 int main(void)
8 {
9  unsigned u;
10 
11  for(u=0; u<65536; u++) {
12  unsigned s = u*u;
13  unsigned root = ff_sqrt(s);
14  unsigned root_m1 = ff_sqrt(s-1);
15  if (s && root != u) {
16  fprintf(stderr, "ff_sqrt failed at %u with %u\n", s, root);
17  return 1;
18  }
19  if (u && root_m1 != u - 1) {
20  fprintf(stderr, "ff_sqrt failed at %u with %u\n", s, root);
21  return 1;
22  }
23  }
24  return 0;
25 }
26 #endif /* TEST */
const char * s
Definition: avisynth_c.h:631
#define ff_sqrt
Definition: mathops.h:214
int main(int argc, char **argv)
Definition: main.c:22