source: tests/src/test-mathutils.c @ 5f9df77

feature/autosinkfeature/cnnfeature/cnn_orgfeature/constantqfeature/crepefeature/crepe_orgfeature/pitchshiftfeature/pydocstringsfeature/timestretchfix/ffmpeg5pitchshiftsamplertimestretchyinfft+
Last change on this file since 5f9df77 was d314636, checked in by Paul Brossier <piem@piem.org>, 14 years ago

test-mathutils.c: added tests for next_power_of_two

  • Property mode set to 100644
File size: 465 bytes
Line 
1#include <stdio.h>
2#include <assert.h>
3#include <aubio.h>
4
5int main(){
6  int a, b;
7
8  a = 31; b = aubio_next_power_of_two(a);
9  fprintf(stdout, "next_power_of_two of %d is %d\n", a, b);
10  assert(b == 32);
11
12  a = 32; b = aubio_next_power_of_two(a);
13  fprintf(stdout, "next_power_of_two of %d is %d\n", a, b);
14  assert(b == 32);
15
16  a = 33; b = aubio_next_power_of_two(a);
17  fprintf(stdout, "next_power_of_two of %d is %d\n", a, b);
18  assert(b == 64);
19
20  return 0;
21}
22
Note: See TracBrowser for help on using the repository browser.