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


Groups > comp.lang.javascript > #27026 > unrolled thread

Bignumb addition function, suggestion improvements.

Started byjonas.thornvall@gmail.com
First post2015-03-14 04:15 -0700
Last post2015-03-15 05:30 -0700
Articles 2 on this page of 22 — 5 participants

Back to article view | Back to comp.lang.javascript


Contents

  Bignumb addition function, suggestion improvements. jonas.thornvall@gmail.com - 2015-03-14 04:15 -0700
    Re: Bignumb addition function, suggestion improvements. jonas.thornvall@gmail.com - 2015-03-14 04:40 -0700
      Re: Bignumb addition function, suggestion improvements. jonas.thornvall@gmail.com - 2015-03-14 04:56 -0700
    Re: Bignumb addition function, suggestion improvements. Ben Bacarisse <ben.usenet@bsb.me.uk> - 2015-03-14 13:41 +0000
      Re: Bignumb addition function, suggestion improvements. jonas.thornvall@gmail.com - 2015-03-14 10:17 -0700
        Re: Bignumb addition function, suggestion improvements. Ben Bacarisse <ben.usenet@bsb.me.uk> - 2015-03-14 19:39 +0000
          Re: Bignumb addition function, suggestion improvements. Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2015-03-14 20:56 +0100
          Re: Bignumb addition function, suggestion improvements. jonas.thornvall@gmail.com - 2015-03-15 01:52 -0700
            Re: Bignumb addition function, suggestion improvements. jonas.thornvall@gmail.com - 2015-03-15 02:57 -0700
              Re: Bignumb addition function, suggestion improvements. jonas.thornvall@gmail.com - 2015-03-15 03:07 -0700
      Re: Bignumb addition function, suggestion improvements. jonas.thornvall@gmail.com - 2015-03-14 10:57 -0700
      Re: Bignumb addition function, suggestion improvements. jonas.thornvall@gmail.com - 2015-03-15 03:40 -0700
        Re: Bignumb addition function, suggestion improvements. Ben Bacarisse <ben.usenet@bsb.me.uk> - 2015-03-15 11:06 +0000
        Re: Bignumb addition function, suggestion improvements. jonas.thornvall@gmail.com - 2015-03-15 04:09 -0700
    Re: Bignumb addition function, suggestion improvements. Dr.Kral@nyc.rr.com - 2015-03-14 19:51 -0400
      Re: Bignumb addition function, suggestion improvements. jonas.thornvall@gmail.com - 2015-03-14 23:57 -0700
      Re: Bignumb addition function, suggestion improvements. jonas.thornvall@gmail.com - 2015-03-15 00:08 -0700
    Re: Bignumb addition function, suggestion improvements. John Harris <niam@jghnorth.org.uk.invalid> - 2015-03-15 10:46 +0000
      Re: Bignumb addition function, suggestion improvements. jonas.thornvall@gmail.com - 2015-03-15 04:12 -0700
        Re: Bignumb addition function, suggestion improvements. jonas.thornvall@gmail.com - 2015-03-15 06:00 -0700
      Re: Bignumb addition function, suggestion improvements. jonas.thornvall@gmail.com - 2015-03-15 04:27 -0700
        Re: Bignumb addition function, suggestion improvements. jonas.thornvall@gmail.com - 2015-03-15 05:30 -0700

Page 2 of 2 — ← Prev page 1 [2]


#27051

Fromjonas.thornvall@gmail.com
Date2015-03-15 04:27 -0700
Message-ID<8353f3d4-0b31-42b0-a985-65c0ac7256f1@googlegroups.com>
In reply to#27047
Den söndag 15 mars 2015 kl. 11:46:16 UTC+1 skrev John Harris:
> On Sat, 14 Mar 2015 04:15:24 -0700 (PDT), jonas.thornvall@gmail.com
> wrote:
> 
> >I just wrote a big numb addition function this morning, it is a bit silly and naive, not pure string not pure integer. I think it is correct, but i may have missed leading last digit.
> >
> >Suggestions to write it shorter and more clear, but keeping the naive approach appreciated.
>   <snip>
> 
> Have you considered a different way of organising the system? That is
> to use anybase as nothing but a display mode, and do all the internal
> storage and operations on binary numbers.
> 
> Thus, if the user types in an octal number you convert it to binary
> before storing it, then display the last entry in the current radix,
> which could be base 13 for example.
> 
>   John

Maybe it prove to be faster add, subtract, multiply terms with bignumbs 1000 of digits in really big bases like 4096 than do it binary.

I am pretty cluess regarding hardware so i may be dreaming here. But could the work doing string manipulations be faster than binary arithmetic?

Can highlevel approaches save work?

[toc] | [prev] | [next] | [standalone]


#27052

Fromjonas.thornvall@gmail.com
Date2015-03-15 05:30 -0700
Message-ID<6993e87a-cf97-4d02-8333-39a2f9bfa710@googlegroups.com>
In reply to#27051
Den söndag 15 mars 2015 kl. 12:27:31 UTC+1 skrev jonas.t...@gmail.com:
> Den söndag 15 mars 2015 kl. 11:46:16 UTC+1 skrev John Harris:
> > On Sat, 14 Mar 2015 04:15:24 -0700 (PDT), jonas.thornvall@gmail.com
> > wrote:
> > 
> > >I just wrote a big numb addition function this morning, it is a bit silly and naive, not pure string not pure integer. I think it is correct, but i may have missed leading last digit.
> > >
> > >Suggestions to write it shorter and more clear, but keeping the naive approach appreciated.
> >   <snip>
> > 
> > Have you considered a different way of organising the system? That is
> > to use anybase as nothing but a display mode, and do all the internal
> > storage and operations on binary numbers.
> > 
> > Thus, if the user types in an octal number you convert it to binary
> > before storing it, then display the last entry in the current radix,
> > which could be base 13 for example.
> > 
> >   John
> 
> Maybe it prove to be faster add, subtract, multiply terms with bignumbs 1000 of digits in really big bases like 4096 than do it binary.
> 
> I am pretty cluess regarding hardware so i may be dreaming here. But could the work doing string manipulations be faster than binary arithmetic?
> 
> Can highlevel approaches save work?

Is it proven that binary operations are the fastest arithmetic?

[toc] | [prev] | [standalone]


Page 2 of 2 — ← Prev page 1 [2]

Back to top | Article view | comp.lang.javascript


csiph-web