Path: csiph.com!usenet.pasdenom.info!weretis.net!feeder1.news.weretis.net!news.swapon.de!eternal-september.org!feeder.eternal-september.org!mx02.eternal-september.org!.POSTED!not-for-mail From: Ben Bacarisse Newsgroups: comp.lang.javascript Subject: Re: Optimise adder Date: Fri, 22 May 2015 10:45:01 +0100 Organization: A noiseless patient Spider Lines: 56 Message-ID: <87vbflhroi.fsf@bsb.me.uk> References: <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> <87382pll4i.fsf@bsb.me.uk> <5c25f904-8d8f-46e9-8366-d8263c30f23a@googlegroups.com> <87fv6pjzn2.fsf@bsb.me.uk> <81ccaab4-6fe5-47da-b626-3f3fe11b9829@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: mx02.eternal-september.org; posting-host="017616aa25f81ec581c44d76d61ba2f3"; logging-data="27949"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+k/p0CTqsL/1dnZmTmB32kSDUFJl7M+OM=" Cancel-Lock: sha1:zI/gn5Arhx1CzjraH4R2b4o33+A= sha1:GgvSvRqh4gJB1LdCp9RLqCBtus0= X-BSB-Auth: 1.40fa335e9a996463c0e8.20150522104501BST.87vbflhroi.fsf@bsb.me.uk Xref: csiph.com comp.lang.javascript:27811 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: >> >> >> >> >> > 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]; >> >> > 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. > 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.