Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!1.eu.feeder.erje.net!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: Thu, 21 May 2015 17:04:16 +0100 Organization: A noiseless patient Spider Lines: 43 Message-ID: <87vbfllxxb.fsf@bsb.me.uk> References: <874mn6m0tt.fsf@bsb.me.uk> <140fbc59-9fd9-41dd-bcb5-55b8c304e5b8@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: mx02.eternal-september.org; posting-host="017616aa25f81ec581c44d76d61ba2f3"; logging-data="1756"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/AD7OcsIEufcR0ebpGlhwYGbXq8xIL5LM=" Cancel-Lock: sha1:aGbgJuf41SemBGwDUA6dY/1iPa4= sha1:sHOSpDHbPJPfLOihGxvRpZVJpLc= X-BSB-Auth: 1.657850104061453cb087.20150521170416BST.87vbfllxxb.fsf@bsb.me.uk Xref: csiph.com comp.lang.javascript:27792 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. >> >> >> -- >> 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. The discussion would be more productive if you addressed the points made rather than quoting the full message and the adding something that you feel is relevant at the end. I explain exactly why your code does not permit any base and exactly why I though that was a key part of your project. You did not address either of these points. -- Ben.