Math.sumPrecise is a stage3 TC39 proposal github.com/tc39/proposal-…
@bunjavascript Finally, precise math.
@bunjavascript whats the implementation behind Math.sumPrecise? kahan? pairwise? something custom? and how does it scale with large arrays (10k+ floats)? curious where the perf/accuracy tradeoff lands
@bunjavascript can you try: Math.sumPrecise([0.1000000000000001, 0.2000000000000001, 0.3000000000000001, -0.5000000000000002, 0.1000000000000001]) => 0.20000000000000018 (result) => 0.2000000000000002 (expected)
@bunjavascript interesting, what other proposals have been implemented in Bun?
@bunjavascript Bun’s out here fixing JavaScript one release at a time
@bunjavascript what about Math.diffPrecise? mulPrecise? divPrecise?
@bunjavascript It's not just precise. It's also extremely specific.
@bunjavascript Would be nice to get support for compiling in dynamic imports. Even if it is just importing the entire node_modules, it would be nice for those of us who like to deploy a single executable.
@bunjavascript Nice! Handles floating-point precision issues? Big improvement for financial apps.
@bunjavascript NO WAY. THIS IS AMAZING. FINALLY. THANK YOU BUN TEAM
@bunjavascript eat breadalso learn math, what a newton
@bunjavascript It took what, like 30 years for us to have correct calculations in JS? Nice, this is the language that runs the browsers
@bunjavascript please, fix it, more one year github.com/oven-sh/bun/is…