liamappelbe / fftea

A simple and efficient FFT implementation for Dart
Apache License 2.0
66 stars 1 forks source link

The integer literal can't be represented exactly in JavaScript #17

Closed alemoreau closed 2 years ago

alemoreau commented 2 years ago

Thank you a lot for this great plugin ! It works perfectly on Android, but I get this error on web :

The integer literal 0xAAAAAAAAAAAAAAAA can't be represented exactly
in JavaScript

I was planing on replacing all those 64bits integer litterals by something along the line of this. for my app. Do you know if there would be a better way ?

liamappelbe commented 2 years ago

Those integer literals are only used if your input array is absolutely huge (more than 2^32 elements). I should just not support such huge FFTs. Under the current implementation, an FFT that large will try to allocate tens of GB of memory, and take several minutes (estimated). So this library is not suited to such large FFTs anyway.

I'll remove support for enormous arrays and truncate these constants. That should fix your bug.