Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.javascript > #27817

Re: Optimise adder

From Ben Bacarisse <ben.usenet@bsb.me.uk>
Newsgroups comp.lang.javascript
Subject Re: Optimise adder
Date 2015-05-22 13:17 +0100
Organization A noiseless patient Spider
Message-ID <87egm8iz7h.fsf@bsb.me.uk> (permalink)
References (9 earlier) <87fv6pjzn2.fsf@bsb.me.uk> <cae20a0c-edde-4c45-a77d-ade26de8dba8@googlegroups.com> <29bf48fc-683e-49c9-8620-9099866254a2@googlegroups.com> <871ti9j6f1.fsf@bsb.me.uk> <81f7179d-9a6c-4f97-bd04-da95d2d4f084@googlegroups.com>

Show all headers | View raw


jonas.thornvall@gmail.com writes:

> Den fredag 22 maj 2015 kl. 11:41:27 UTC+2 skrev Ben Bacarisse:
>> jonas.thornvall@gmail.com writes:
>> <snip>
>> > But when base is an array you have to shift approach and use the
>> > functions arrCompare and naiveSub.
>> >
>> > I am not 100% sure i could program it, because it get very convoluted
>> > with the function calls i don't think it is recursion, but a nested
>> > structure.
>> 
>> Your use of globals makes it almost impossible.  A re-write is essential
>> to make any progress.  The trouble is, the people who know how to
>> program it also know it's not worthwhile programming it.
<snip>
> To be honest Ben i am pretty satisfied with bases up to
> 900719925474092,

Try multiplying numbers with digits in that base.

Here's a question you really should try to answer.  What bases *can* you
use for your arithmetic?

> but of course for the sake of generality, and doing
> arithmetic on any size of number "in decent time" it would be
> preferable with bases of just any size. I think it would take me a
> week to get it working.

Long ago you made a claim that no one believed -- that because
arithmetic is faster the larger the base, using "bignums" for the base
as well will make the arithmetic faster still.  To prove that
implausible claim you would need to do the work, but your code is not
suitable.  The use of globals makes the recursion required almost
impossible to manage.

> But there is other things that i find more worthwhile doing,

Very wise.  Handling any base is not currently an option.  Will you
withdraw the claim now that you've decided other things are more
worthwhile?

<snip>
-- 
Ben.

Back to comp.lang.javascript | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


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