FastLED 3.9.15
Loading...
Searching...
No Matches

◆ kf_factor()

static void kf_factor ( int n,
int * facbuf )
static

Definition at line 316 of file kiss_fft.cpp.hpp.

317{
318 int p=4;
319 double floor_sqrt;
320 floor_sqrt = fl::floor( fl::sqrt((double)n) );
321
322 /*factor out powers of 4, powers of 2, then any remaining primes */
323 do {
324 while (n % p) {
325 switch (p) {
326 case 4: p = 2; break;
327 case 2: p = 3; break;
328 default: p += 2; break;
329 }
330 if (p > floor_sqrt)
331 p = n; /* no more factors, skip to end */
332 }
333 n /= p;
334 *facbuf++ = p;
335 *facbuf++ = n;
336 } while (n > 1);
337}
constexpr enable_if< is_fixed_point< T >::value, T >::type sqrt(T x) FL_NOEXCEPT
constexpr enable_if< is_fixed_point< T >::value, T >::type floor(T x) FL_NOEXCEPT

References FL_NOEXCEPT, fl::floor(), and fl::sqrt().

Referenced by kiss_fft_alloc().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: