News for hackers. Stuff that matters.
Re:Adding BigInts to V8 by ScottBurson on Thursday May 03, 2018 @02:53AM (#16983865)
I tried this in Common Lisp:

  (defun tetrate (a n)
    (if (= n 0) 1
      (expt a (tetrate a (1- n)))))
  (compile 'tetrate)
  (time (integer-length (tetrate 7 3))
I used 'integer-length' to check that a number of the correct magnitude was produced without actually having 700kB of digits dumped into my REPL buffer. On a new MacBook Pro running SBCL, this took, ah, 624 milliseconds. So there's some room for optimization of the JavaScript implementation :-)

There are no comments on this comment yet.