Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.javascript > #27814
| From | Ben Bacarisse <ben.usenet@bsb.me.uk> |
|---|---|
| Newsgroups | comp.lang.javascript |
| Subject | Re: Optimise adder |
| Date | 2015-05-22 11:25 +0100 |
| Organization | A noiseless patient Spider |
| Message-ID | <87pp5sj4cz.fsf@bsb.me.uk> (permalink) |
| References | (8 earlier) <5c25f904-8d8f-46e9-8366-d8263c30f23a@googlegroups.com> <87fv6pjzn2.fsf@bsb.me.uk> <81ccaab4-6fe5-47da-b626-3f3fe11b9829@googlegroups.com> <87vbflhroi.fsf@bsb.me.uk> <b18f88ed-432c-4e53-b7d6-19cd8ade7c93@googlegroups.com> |
jonas.thornvall@gmail.com writes: > Den fredag 22 maj 2015 kl. 11:45:06 UTC+2 skrev Ben Bacarisse: >> jonas.thornvall@gmail.com writes: >> >> > Den fredag 22 maj 2015 kl. 01:10:16 UTC+2 skrev Ben Bacarisse: >> >> jonas.thornvall@gmail.com writes: >> >> >> >> > Den torsdag 21 maj 2015 kl. 22:40:50 UTC+2 skrev Ben Bacarisse: >> >> >> 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: >> >> <snip> >> >> >> >> >> > 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]; >> >> <snip> >> >> > Yes i did and i got 1,1 in any brwoser. >> >> >> >> I'm having a hard time believing you. Partly because you've posted two >> >> examples that *look* similar but are, in fact, different (so maybe you >> >> have a typo somewhere in your test), partly because I've just tried >> >> another two implementations and I can't get anything but [0,1] in any of >> >> them, but mostly because I know how ECMAScript Numbers are defined so I >> >> know how these numbers get processed by your function. >> >> >> >> > For your example, except you do apparently wrong when defining >> >> > arrOne base-1. Try arrOne = [9007199254740991] >> >> >> >> Yes, I did that. Two command-line implementations and (now) five >> >> browsers all gave the same incorrect result. Put your test case >> >> (i.e. for base = 9007199254740992, arrOne = [9007199254740991] and >> >> arrTwo = [2]) on a public page and I'll try it with the browsers I have. >> <snip> >> >> > Iexplorer, firefox and Chrome all give the correct answer 1,1 >> >> Yes, of course. That's not the test case I gave you. >> >> > http://jt.node365.se/add.html >> >> I was right not to believe you and I am not 100% sure it was a genuine >> mistake. >> >> -- >> Ben. > > What to you mean do you suggest that, my function responsible for > base-1 in your definition of the array? That must be javascript doing > something weird not the function or? I do not think i understand what > you mean, please clarify? I posted an example base that does not work. You copied it incorrectly and claimed my example was wrong, when the error was in your copying. > If it bugs out on base - 1 but not on var arrOne = [900719925474091]; > it certainly can not be because of the function? > > base=900719925474092; That was not the base I gave you. I wrote: base=9007199254740992. > var arrOne = [900719925474091]; //Is different from base-1? I suggested 9007199254740991 and you actually said that you have tried that number but the code posted today used this other number. > var arrTwo = [2]; -- 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