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

◆ kf_factor()

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

Definition at line 303 of file kiss_fft.c.

304{
305 int p=4;
306 double floor_sqrt;
307 floor_sqrt = floor( sqrt((double)n) );
308
309 /*factor out powers of 4, powers of 2, then any remaining primes */
310 do {
311 while (n % p) {
312 switch (p) {
313 case 4: p = 2; break;
314 case 2: p = 3; break;
315 default: p += 2; break;
316 }
317 if (p > floor_sqrt)
318 p = n; /* no more factors, skip to end */
319 }
320 n /= p;
321 *facbuf++ = p;
322 *facbuf++ = n;
323 } while (n > 1);
324}
T floor(T value)
Definition math.h:11
static FASTLED_NAMESPACE_BEGIN uint8_t const p[]
Definition noise.cpp:30

References p.

Referenced by kiss_fft_alloc().

+ Here is the caller graph for this function: