Comment

Comment by Fredkin

Math.sin(x)/x (the sinc function) for 7 terms over [-3,3] gives coefficients c0...c6 that are all NaNs. Is this a bug?

To work around it, I handled the x near zero case by just forcing to 1.0.

if(Math.abs(x) > 1e-8 ){ Math.sin(x)/x } else { 1.0 }

parent Fredkin 2 years ago

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton