Skip to content

kiss_fft_next_fast_size endless loop with input 0 #121

Description

@simonArchipoff

I cam accross this little problem by accident, I guess the function should return 0 in this case (?) or should it KISS_FFT_ERROR ?
Here's the current implementation.

int kiss_fft_next_fast_size(int n)
{
    while(1) {
        int m=n;
        while ( (m%2) == 0 ) m/=2;
        while ( (m%3) == 0 ) m/=3;
        while ( (m%5) == 0 ) m/=5;
        if (m<=1)
            break; /* n is completely factorable by twos, threes, and fives */
        n++;
    }
    return n;
}

I can do the PR once I know what to do :-)
Regards,
Simon

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions