Open stepaniukm opened 2 weeks ago
Bun uses JavaScriptCore which limits BigInt to 2^20 - 1 bits (~1 million), while Node and Deno use V8 which seems to set the limit at 2^30 - 1 (~1 billion). We can investigate how hard it is to increase JSC's limit.
What version of Bun is running?
1.1.34+5e5e7c60f
What platform is your computer?
Darwin 24.1.0 arm64 arm
What steps can reproduce the bug?
Given the following function for calculating fib numbers
When testing just for fun, in Bun already around
console.log(fib(1_750_000));
on my machine I started getting error:But, the exact same code works both in Node and Deno, so as per your approach, you consider that as a bug in Bun. I've tested the code in Deno and Node, and on my machine, I could easily go up to
n=3_000_000
and it worked fine. Probably the limits in both of these runtimes are even higher, but that I think is enough already for submitting this issue.What is the expected behavior?
I expect Bun, to work the same as Node and Deno, and give me correct output.
What do you see instead?
Above described
RangeError
Additional information
Other runtimes used for testing: