3 ms·
There are not many JS libraries in this space that have sane handling for complex numbers and arbitrary precision. I'm not entirely sure, but perhaps NumericJS
by niftich 10y ago
There are not many JS libraries in this space that have sane handling for complex numbers and arbitrary precision.
I'm not entirely sure, but perhaps NumericJS [1] would have what you're looking for?
[1] http://www.numericjs.com/documentation.html http://www.numericjs.com/documentation.html
- valera_rozuvan 10y agoThanks for your reply. But after trying this library - it doesn't offer precision beyond that which is in native JavaScript. Upon closer inspection [1] you can see that it uses standard Number.toPrecision() function. ECMA-262 only requires a precision of up to 21 significant digits [2]. This is no good for me. [1] https://github.com/sloisel/numeric/blob/656fa1254be540f428710738ca9c1539625777f1/src/numeric.js#L46 https://github.com/sloisel/numeric/blob/656fa1254be540f42871... [2] https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_objects/Number/toPrecision#Exceptions https://developer.mozilla.org/en/docs/Web/JavaScript/Referen...
- tucaz 10y agoI'm going to ask a really stupid question, but here it goes: why the need for such precision? (just curiosity)
- valera_rozuvan 10y ago=) A valid question! I am developing (yet another) fractal viewer for the browser. It's called FractalViewer, and is available from GitHub [1]. I am working on allowing it to zoom past the limit of about 10^(-13). The specific FractalViewer development issue is [2]. Why bother at all? I am very frustrated that there currently is no fractal viewer for the browser that can do a truly deep zoom. See a list I compiled on web-based fractal viewers [3]. Maybe someone can correct me, and point to a JavaScript based fractal viewer that can do really deep zooms... [1] https://github.com/valera-rozuvan/FractalViewer https://github.com/valera-rozuvan/FractalViewer [2] https://github.com/valera-rozuvan/FractalViewer/issues/10 https://github.com/valera-rozuvan/FractalViewer/issues/10 [3] https://github.com/valera-rozuvan/bookmarks-md/blob/master/fractals.md#html--js-interactive-fractals https://github.com/valera-rozuvan/bookmarks-md/blob/master/f...
- GregBuchholz 10y agoHave you heard of Fracint, the mandelbrot generator that uses integer math? http://www.fractint.org/ http://www.fractint.org/
- valera_rozuvan 10y ago@GregBuchholz Of course. I know many programs that allow deep zooms of fractals. However, I am after an implementation in the browser.
- GregBuchholz 10y agoIt wasn't clear that you've looked at its implementation of arbitrary precision floating point numbers without using floating point numbers and found it wanting.
- valera_rozuvan 10y agoThe author of Fractint, Wes Loewer, created his own arbitrary precision math library [1]. I am aware of how such pieces of software work. I am also aware that to create such a thing from scratch - will take much effort. Especially testing it for correctness. Why reinvent the wheel? That's why I asked the question in the first place. Best case scenario - someone has already implemented such functionality in JavaScript (with complex numbers). But I think that this is not the case. So I guess this leads to the case of porting from some other language. [1] http://www.nahee.com/spanky/www/fractint/arb-prec.html http://www.nahee.com/spanky/www/fractint/arb-prec.html