Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RangeError: Maximum call stack size exceeded #4

Open
devangnithin opened this issue Aug 16, 2017 · 1 comment
Open

RangeError: Maximum call stack size exceeded #4

devangnithin opened this issue Aug 16, 2017 · 1 comment

Comments

@devangnithin
Copy link

devangnithin commented Aug 16, 2017

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**

@joshjung
Copy link
Collaborator

Would you mind submitting a PR to fix this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants