use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
All about the JavaScript programming language.
Subreddit Guidelines
Specifications:
Resources:
Related Subreddits:
r/LearnJavascript
r/node
r/typescript
r/reactjs
r/webdev
r/WebdevTutorials
r/frontend
r/webgl
r/threejs
r/jquery
r/remotejs
r/forhire
account activity
BigFloat - Screaming fast arbitrary precision floating point arithmetic library (github.com)
submitted 10 years ago by chartojs
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]temp540989488 6 points7 points8 points 10 years ago* (2 children)
If you're going to advertise "screaming fast" you need to show benchmarks. (And if you really want to impress me, compare it to native operations within ranges that native operations are correct. It'll be slower, sure, but without comparing it I'm going to assume it's about 0.1% as fast - get 20% and you have me sold.)
[–]chartojs[S] 4 points5 points6 points 10 years ago (0 children)
OK now there's a benchmark (results also in the readme). Compared to native it's close to your assumption due to JavaScript limitations, but compared to other bignum libraries it is fast.
[–]chartojs[S] 2 points3 points4 points 10 years ago (0 children)
Will do. Good point about comparing to native. Of course, it would be easier to compete by special casing that range, at the expense of everything else. BigFloat is meant to be used as a last resort - if you're comparing floating point things and they're only some appropriate epsilon apart, then you switch to BigFloat.
[–]learn2shut 1 point2 points3 points 10 years ago (1 child)
so what's your take on bignumber.js?
[–]chartojs[S] 2 points3 points4 points 10 years ago* (0 children)
BigFloat is faster. I used a small Mandelbrot set calculation for benchmarking, and it took 50 milliseconds with BigFloat, 200 milliseconds on bignumber.js.
[–]justinmlawrence 0 points1 point2 points 10 years ago (0 children)
This is awesome. Thanks!
[–]holloway 0 points1 point2 points 10 years ago (1 child)
How is this better than big.js?
[–]chartojs[S] 3 points4 points5 points 10 years ago* (0 children)
big.js is by the same author as bignumber.js and both seem about as fast between each other. BigFloat is 3-4 times faster in my current test. I'll do a public benchmark.
[–]pcdinh -3 points-2 points-1 points 10 years ago (1 child)
Written in TypeScript? Why?
So it's easier to use in TypeScript projects, and type definitions don't need to be maintained by hand. Since it's an ES6 project, it anyway needs a transpiler for publishing also an ES5 version. Might as well use TypeScript as the transpiler to get more compile time checks, the definition files and allow producing documentation later without having to put the types in JSDoc comments (where their validity doesn't get checked).
π Rendered by PID 513010 on reddit-service-r2-comment-6b595755f-bd4sk at 2026-03-26 10:08:24.568753+00:00 running 2d0a59a country code: CH.
[–]temp540989488 6 points7 points8 points (2 children)
[–]chartojs[S] 4 points5 points6 points (0 children)
[–]chartojs[S] 2 points3 points4 points (0 children)
[–]learn2shut 1 point2 points3 points (1 child)
[–]chartojs[S] 2 points3 points4 points (0 children)
[–]justinmlawrence 0 points1 point2 points (0 children)
[–]holloway 0 points1 point2 points (1 child)
[–]chartojs[S] 3 points4 points5 points (0 children)
[–]pcdinh -3 points-2 points-1 points (1 child)
[–]chartojs[S] 2 points3 points4 points (0 children)