Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.javascript > #29227
| Path | csiph.com!eternal-september.org!feeder.eternal-september.org!mx02.eternal-september.org!.POSTED!not-for-mail |
|---|---|
| From | Ben Bacarisse <ben.usenet@bsb.me.uk> |
| Newsgroups | comp.lang.javascript |
| Subject | Re: Improve speed calculations? |
| Date | Mon, 11 Jan 2016 13:28:10 +0000 |
| Organization | A noiseless patient Spider |
| Lines | 29 |
| Message-ID | <87si24w8id.fsf@bsb.me.uk> (permalink) |
| References | <86bb6f49-d74d-426d-bc2a-5b4cd7199bf4@googlegroups.com> <69c96cdd-1020-470c-b0b2-66e2898468bb@googlegroups.com> |
| Mime-Version | 1.0 |
| Content-Type | text/plain; charset=iso-8859-1 |
| Content-Transfer-Encoding | 8bit |
| Injection-Info | mx02.eternal-september.org; posting-host="017616aa25f81ec581c44d76d61ba2f3"; logging-data="19337"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19H+LlVHPj7OIo67p4Ku/d+ejck2Vh6g14=" |
| Cancel-Lock | sha1:7ras1zZGfoESZcJnnzeBzjjsjBQ= sha1:M+hAzvoB/dl8jqi1UjdsJqNnbdo= |
| X-BSB-Auth | 1.e654d170d7f7c3c862b4.20160111132810GMT.87si24w8id.fsf@bsb.me.uk |
| Xref | csiph.com comp.lang.javascript:29227 |
Show key headers only | View raw
jonas.thornvall@gmail.com writes: > Den söndag 10 januari 2016 kl. 14:33:27 UTC+1 skrev jonas.t...@gmail.com: >> <script language="Javascript"> <snip code> > http://jt.node365.se/BAUTABASE.html > > Using the biggest base possible adding "4503599627370495" encoding > fibonacci in javascript without overflow. > > Also fixed ambiguity reading out the numbers in bases over ten by > using separator for digitplaces. The add can not cause overflow but to > get rid of base overflow would require some real deep thinking. > > The 100000th Fibonacci took 34 seconds i do not think i can get it > much faster in javascript if your a wizard please prove me wrong. I have not tried your code, but I've just written a quick bignum add function and I can get fib(100000) in about 3.5 seconds. If I have time to unravel yours, I'll do a comparative test. Note that a language with a good bignum type (Haskell, for example) will do it in less than 100th of a second. Note that your 'challenge' makes it easy to optimise the code. For example, using a power of 10 as the base makes the conversion for printing very simple. -- Ben.
Back to comp.lang.javascript | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Improve speed calculations? jonas.thornvall@gmail.com - 2016-01-10 05:33 -0800
Re: Improve speed calculations? jonas.thornvall@gmail.com - 2016-01-11 03:19 -0800
Re: Improve speed calculations? jonas.thornvall@gmail.com - 2016-01-11 04:41 -0800
Re: Improve speed calculations? Ben Bacarisse <ben.usenet@bsb.me.uk> - 2016-01-11 13:28 +0000
Re: Improve speed calculations? Silvio <silvio@internet.com> - 2016-01-11 15:41 +0100
Re: Improve speed calculations? Ben Bacarisse <ben.usenet@bsb.me.uk> - 2016-01-11 15:44 +0000
Re: Improve speed calculations? jonas.thornvall@gmail.com - 2016-01-11 07:53 -0800
Re: Improve speed calculations? jonas.thornvall@gmail.com - 2016-01-11 07:56 -0800
Re: Improve speed calculations? jonas.thornvall@gmail.com - 2016-01-11 08:28 -0800
Re: Improve speed calculations? jonas.thornvall@gmail.com - 2016-01-11 06:48 -0800
csiph-web