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

◆ kf_factor()

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

Definition at line 307 of file kiss_fft.cpp.

308{
309 int p=4;
310 double floor_sqrt;
311 floor_sqrt = floor( sqrt((double)n) );
312
313 /*factor out powers of 4, powers of 2, then any remaining primes */
314 do {
315 while (n % p) {
316 switch (p) {
317 case 4: p = 2; break;
318 case 2: p = 3; break;
319 default: p += 2; break;
320 }
321 if (p > floor_sqrt)
322 p = n; /* no more factors, skip to end */
323 }
324 n /= p;
325 *facbuf++ = p;
326 *facbuf++ = n;
327 } while (n > 1);
328}
T floor(T value)
Definition math.h:32

Referenced by kiss_fft_alloc().

+ Here is the caller graph for this function: