Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.javascript > #27799
| Path | csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!us.feeder.erje.net!newsfeed.fsmpi.rwth-aachen.de!newsfeed.straub-nv.de!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: Optimise adder |
| Date | Thu, 21 May 2015 21:40:45 +0100 |
| Organization | A noiseless patient Spider |
| Lines | 69 |
| Message-ID | <87382pll4i.fsf@bsb.me.uk> (permalink) |
| References | <a93ee3a0-39f5-408b-9f33-8d193e22e0dc@googlegroups.com> <874mn6m0tt.fsf@bsb.me.uk> <140fbc59-9fd9-41dd-bcb5-55b8c304e5b8@googlegroups.com> <87vbfllxxb.fsf@bsb.me.uk> <69862aa5-cdf8-4d22-beca-c37c59b90e63@googlegroups.com> <87egm9lpmh.fsf@bsb.me.uk> <2823f00c-b09d-45df-b14c-5eadf3d141b8@googlegroups.com> |
| Mime-Version | 1.0 |
| Content-Type | text/plain |
| Injection-Info | mx02.eternal-september.org; posting-host="017616aa25f81ec581c44d76d61ba2f3"; logging-data="11377"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19EhUaz2c/ZWgNsBh66kh9snPKiFYygL8U=" |
| Cancel-Lock | sha1:qQoT++QTghtvmQmCw4zBEaNMGs4= sha1:OKzeF6xHQ2vZR1u6d7Bm2pWZYU8= |
| X-BSB-Auth | 1.a05f22dd54b4d84f011d.20150521214045BST.87382pll4i.fsf@bsb.me.uk |
| Xref | csiph.com comp.lang.javascript:27799 |
Show key headers only | View raw
jonas.thornvall@gmail.com writes: > Den torsdag 21 maj 2015 kl. 21:03:40 UTC+2 skrev Ben Bacarisse: >> jonas.thornvall@gmail.com writes: >> >> > Den torsdag 21 maj 2015 kl. 18:04:22 UTC+2 skrev Ben Bacarisse: >> >> jonas.thornvall@gmail.com writes: >> >> >> >> > Den torsdag 21 maj 2015 kl. 17:01:39 UTC+2 skrev Ben Bacarisse: >> >> >> jonas.thornvall@gmail.com writes: >> >> >> >> >> >> > Feel free try to make it faster >> >> >> >> >> >> Optimising bad code is not an appealing project. >> >> >> >> >> >> The correct plan is to re-write it as a proper function and, what's >> >> >> more, make it a function that operates on some big number object type. >> >> >> >> >> >> > but still keep it general "anybase". >> >> >> >> >> >> It does not seem to permit any base. You claimed to be allowing >> >> >> arbitrary precision numbers as the base, but the code assumes that the >> >> >> base is an ECMAScript Number value. >> >> >> >> >> >> <snip> >> >> >> -- >> >> >> Ben. >> >> >> >> Is there any chance that I can persuade you to follow Usenet conventions >> >> and (1) snip signatures; (2) reply in-line to the points being made? >> >> >> >> > Actually it is infinite precision arithmetic, i have no idea what you >> >> > mean you simply feed it two times if you want decimals, and carry over >> >> > a 1 if to the second add if needed. There is no extra penalty in time >> >> > for that. The decimals Points is handled by the parser. >> >> > >> >> > It permit anybase, but you have to format your number into that base >> >> > Before feeding the function, try base two. >> >> >> >> The code you posted does not permit any base. >> > >> > Not true, here i changed base same code, different number format. >> >> Yes, true. Here's a test case for you: >> >> base=9007199254740992; >> var arrOne = [base-1]; >> var arrTwo = [2]; > > You are very confused why do you think it is wrong? > 1,1 > Timing = 4 ms I get [0,1] using two command-line implementations and three browsers. > Think again ..........90+2 would be 1,0 comes out like this. > > 0,1 > Timing = 4 ms > > base=900719925474092; > var arrOne = [900719925474090]; > var arrTwo = [2]; What's this got to do with my example? Did you actually try my test case? -- Ben.
Back to comp.lang.javascript | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Optimise adder jonas.thornvall@gmail.com - 2015-05-21 07:19 -0700
Re: Optimise adder Ben Bacarisse <ben.usenet@bsb.me.uk> - 2015-05-21 16:01 +0100
Re: Optimise adder jonas.thornvall@gmail.com - 2015-05-21 08:43 -0700
Re: Optimise adder jonas.thornvall@gmail.com - 2015-05-21 08:54 -0700
Re: Optimise adder Ben Bacarisse <ben.usenet@bsb.me.uk> - 2015-05-21 17:04 +0100
Re: Optimise adder jonas.thornvall@gmail.com - 2015-05-21 09:13 -0700
Re: Optimise adder Ben Bacarisse <ben.usenet@bsb.me.uk> - 2015-05-21 20:01 +0100
Re: Optimise adder jonas.thornvall@gmail.com - 2015-05-21 12:39 -0700
Re: Optimise adder Ben Bacarisse <ben.usenet@bsb.me.uk> - 2015-05-21 21:43 +0100
Re: Optimise adder jonas.thornvall@gmail.com - 2015-05-21 12:52 -0700
Re: Optimise adder Ben Bacarisse <ben.usenet@bsb.me.uk> - 2015-05-21 21:40 +0100
Re: Optimise adder jonas.thornvall@gmail.com - 2015-05-21 14:30 -0700
Re: Optimise adder Ben Bacarisse <ben.usenet@bsb.me.uk> - 2015-05-22 00:10 +0100
Re: Optimise adder jonas.thornvall@gmail.com - 2015-05-21 23:20 -0700
Re: Optimise adder Ben Bacarisse <ben.usenet@bsb.me.uk> - 2015-05-22 10:45 +0100
Re: Optimise adder jonas.thornvall@gmail.com - 2015-05-22 02:56 -0700
Re: Optimise adder Ben Bacarisse <ben.usenet@bsb.me.uk> - 2015-05-22 11:25 +0100
Re: Optimise adder jonas.thornvall@gmail.com - 2015-05-22 04:37 -0700
Re: Optimise adder Ben Bacarisse <ben.usenet@bsb.me.uk> - 2015-05-22 13:21 +0100
Re: Optimise adder Denis McMahon <denismfmcmahon@gmail.com> - 2015-05-22 18:14 +0000
Re: Optimise adder jonas.thornvall@gmail.com - 2015-05-21 23:24 -0700
Re: Optimise adder jonas.thornvall@gmail.com - 2015-05-22 01:18 -0700
Re: Optimise adder Ben Bacarisse <ben.usenet@bsb.me.uk> - 2015-05-22 10:41 +0100
Re: Optimise adder jonas.thornvall@gmail.com - 2015-05-22 02:52 -0700
Re: Optimise adder Ben Bacarisse <ben.usenet@bsb.me.uk> - 2015-05-22 13:17 +0100
Re: Optimise adder jonas.thornvall@gmail.com - 2015-05-22 05:59 -0700
Re: Optimise adder Ben Bacarisse <ben.usenet@bsb.me.uk> - 2015-05-22 17:37 +0100
Re: Optimise adder Denis McMahon <denismfmcmahon@gmail.com> - 2015-05-22 18:17 +0000
Re: Optimise adder jonas.thornvall@gmail.com - 2015-05-22 12:58 -0700
Re: Optimise adder "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2015-05-23 00:08 +0200
Re: Optimise adder Ben Bacarisse <ben.usenet@bsb.me.uk> - 2015-05-22 10:38 +0100
Re: Optimise adder jonas.thornvall@gmail.com - 2015-05-21 09:05 -0700
Re: Optimise adder Ben Bacarisse <ben.usenet@bsb.me.uk> - 2015-05-21 20:03 +0100
Re: Optimise adder "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2015-05-21 22:51 +0200
Re: Optimise adder jonas.thornvall@gmail.com - 2015-05-21 15:26 -0700
Re: Optimise adder "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2015-05-22 13:40 +0200
Re: Optimise adder Scott Sauyet <scott.sauyet@gmail.com> - 2015-05-26 06:20 -0700
Re: Optimise adder jonas.thornvall@gmail.com - 2015-06-06 04:01 -0700
Re: Optimise adder jonas.thornvall@gmail.com - 2015-06-06 04:09 -0700
Re: Optimise adder jonas.thornvall@gmail.com - 2015-06-06 04:15 -0700
Re: Optimise adder jonas.thornvall@gmail.com - 2015-06-06 05:33 -0700
csiph-web