MCPcopy Create free account
hub / github.com/audacity/audacity / IsPowerOfTwo

Function IsPowerOfTwo

libraries/lib-fft/FFT.cpp:60–69  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

58static void InitFFT();
59
60static bool IsPowerOfTwo(size_t x)
61{
62 if (x < 2)
63 return false;
64
65 if (x & (x - 1)) /* Thanks to 'byang' for this cute trick! */
66 return false;
67
68 return true;
69}
70
71static size_t NumberOfBitsNeeded(size_t PowerOfTwo)
72{

Callers 1

FFTFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected