Hacker News new | ask | show | jobs
by z3t4 841 days ago
Someone asked about integer support in JavaScript. JS now supports BigInt!

  >2**57
  144115188075855870
  >2n**57n
  144115188075855872n
4 comments

And in some JavaScript engines (eg V8) bigint multiplication is asymptotically fast, unlike say the default CPython. It’s a very pleasant surprise if you happen to be a number theorist (say).
How do you mean? CPython uses karatsuba's for large numbers which should be asymptotically fast

https://github.com/python/cpython/blob/d864b0094f9875c5613cb...

Oh thank god.

I've been having to do some hacky things to represent numbers on an astronomical scale for my star system/planet generators.

Yes, I was asking about that and I'm very happy to see this exists now.