Skip to content

RangeError: Maximum call stack size exceeded #4

@devangnithin

Description

@devangnithin

If the passed vector size to fft function has length 0. This runs into an infinite loop and gives an error.

RangeError: Maximum call stack size exceeded error
at var X_evens = fft(vector.filter(even)), in fft.js
It is better to add a condition to check this

if (N == 1) {
if (Array.isArray(vector[0])) //If input vector contains complex numbers
return [[vector[0][0], vector[0][1]]];
else
return [[vector[0], 0]];
} ** else If (N <1) //throw or return error**

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions