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


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

Bignumber conversion and arithmetic on unsigned operand pairs using +,-,* now work in anybase.

Started byjonas.thornvall@gmail.com
First post2015-05-20 06:11 -0700
Last post2015-06-29 04:25 -0700
Articles 20 on this page of 83 — 11 participants

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


Contents

  Bignumber conversion and arithmetic on unsigned operand pairs using +,-,* now work in anybase. jonas.thornvall@gmail.com - 2015-05-20 06:11 -0700
    Re: Bignumber conversion and arithmetic on unsigned operand pairs using +,-,* now work in anybase. jonas.thornvall@gmail.com - 2015-05-20 06:37 -0700
    Re: Bignumber conversion and arithmetic on unsigned operand pairs using +,-,* now work in anybase. "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2015-05-20 17:58 +0200
      Re: Bignumber conversion and arithmetic on unsigned operand pairs using +,-,* now work in anybase. jonas.thornvall@gmail.com - 2015-06-21 09:12 -0700
        Re: Bignumber conversion and arithmetic on unsigned operand pairs using +,-,* now work in anybase. jonas.thornvall@gmail.com - 2015-06-21 09:33 -0700
          Re: Bignumber conversion and arithmetic on unsigned operand pairs using +,-,* now work in anybase. jonas.thornvall@gmail.com - 2015-06-21 10:13 -0700
            Re: Bignumber conversion and arithmetic on unsigned operand pairs using +,-,* now work in anybase. jonas.thornvall@gmail.com - 2015-06-21 11:08 -0700
              Re: Bignumber conversion and arithmetic on unsigned operand pairs using +,-,* now work in anybase. jonas.thornvall@gmail.com - 2015-06-21 11:10 -0700
            Re: Bignumber conversion and arithmetic on unsigned operand pairs using +,-,* now work in anybase. Ben Bacarisse <ben.usenet@bsb.me.uk> - 2015-06-21 21:45 +0100
              Re: Bignumber conversion and arithmetic on unsigned operand pairs using +,-,* now work in anybase. jonas.thornvall@gmail.com - 2015-06-21 13:49 -0700
                Re: Bignumber conversion and arithmetic on unsigned operand pairs using +,-,* now work in anybase. Ben Bacarisse <ben.usenet@bsb.me.uk> - 2015-06-22 01:19 +0100
                  Re: Bignumber conversion and arithmetic on unsigned operand pairs using +,-,* now work in anybase. jonas.thornvall@gmail.com - 2015-06-21 20:24 -0700
                    Re: Bignumber conversion and arithmetic on unsigned operand pairs using +,-,* now work in anybase. Ben Bacarisse <ben.usenet@bsb.me.uk> - 2015-06-22 20:52 +0100
                      Re: Bignumber conversion and arithmetic on unsigned operand pairs using +,-,* now work in anybase. jonas.thornvall@gmail.com - 2015-06-23 05:31 -0700
                      Re: Bignumber conversion and arithmetic on unsigned operand pairs using +,-,* now work in anybase. Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2015-06-23 23:37 +0200
                        Re: Bignumber conversion and arithmetic on unsigned operand pairs using +,-,* now work in anybase. "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2015-06-24 00:13 +0200
                  Re: Bignumber conversion and arithmetic on unsigned operand pairs using +,-,* now work in anybase. Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2015-06-22 06:51 +0200
                    Re: Bignumber conversion and arithmetic on unsigned operand pairs using +,-,* now work in anybase. jonas.thornvall@gmail.com - 2015-06-22 09:15 -0700
                    Re: Bignumber conversion and arithmetic on unsigned operand pairs using +,-,* now work in anybase. Dr J R Stockton <reply1500@merlyn.demon.co.uk.invalid> - 2015-06-23 23:43 +0100
                      Re: Bignumber conversion and arithmetic on unsigned operand pairs using +,-,* now work in anybase. Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2015-06-24 01:03 +0200
                        Re: Bignumber conversion and arithmetic on unsigned operand pairs using +,-,* now work in anybase. "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2015-06-24 09:45 +0200
                          Re: Bignumber conversion and arithmetic on unsigned operand pairs using +,-,* now work in anybase. jonas.thornvall@gmail.com - 2015-06-24 03:42 -0700
                            Re: Bignumber conversion and arithmetic on unsigned operand pairs using +,-,* now work in anybase. jonas.thornvall@gmail.com - 2015-06-25 01:13 -0700
                          Re: Bignumber conversion and arithmetic on unsigned operand pairs using +,-,* now work in anybase. Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2015-06-24 19:31 +0200
                            OT: English dictionaries (was: Bignumber conversion and arithmetic on unsigned operand pairs using +,-,* now work in anybase.) "Christoph M. Becker" <cmbecker69@arcor.de> - 2015-06-24 19:54 +0200
      Re: Bignumber conversion and arithmetic on unsigned operand pairs using +,-,* now work in anybase. jonas.thornvall@gmail.com - 2015-06-25 01:57 -0700
        Re: Bignumber conversion and arithmetic on unsigned operand pairs using +,-,* now work in anybase. "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2015-06-25 12:44 +0200
          Re: Bignumber conversion and arithmetic on unsigned operand pairs using +,-,* now work in anybase. jonas.thornvall@gmail.com - 2015-06-25 04:09 -0700
            Re: Bignumber conversion and arithmetic on unsigned operand pairs using +,-,* now work in anybase. John Harris <niam@jghnorth.org.uk.invalid> - 2015-06-25 15:08 +0100
          Re: Bignumber conversion and arithmetic on unsigned operand pairs using +,-,* now work in anybase. jonas.thornvall@gmail.com - 2015-06-25 09:30 -0700
            Re: Bignumber conversion and arithmetic on unsigned operand pairs using +,-,* now work in anybase. Scott Sauyet <scott.sauyet@gmail.com> - 2015-06-25 13:12 -0700
              Re: Bignumber conversion and arithmetic on unsigned operand pairs using +,-,* now work in anybase. "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2015-06-25 22:21 +0200
                Re: Bignumber conversion and arithmetic on unsigned operand pairs using +,-,* now work in anybase. Scott Sauyet <scott.sauyet@gmail.com> - 2015-06-25 13:28 -0700
                  Re: Bignumber conversion and arithmetic on unsigned operand pairs using +,-,* now work in anybase. jonas.thornvall@gmail.com - 2015-06-25 15:56 -0700
                  Re: Bignumber conversion and arithmetic on unsigned operand pairs using +,-,* now work in anybase. jonas.thornvall@gmail.com - 2015-06-27 19:33 -0700
                    Re: Bignumber conversion and arithmetic on unsigned operand pairs using +,-,* now work in anybase. jonas.thornvall@gmail.com - 2015-06-27 19:45 -0700
                      Re: Bignumber conversion and arithmetic on unsigned operand pairs using +,-,* now work in anybase. "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2015-06-28 09:17 +0200
                        Re: Bignumber conversion and arithmetic on unsigned operand pairs using +,-,* now work in anybase. jonas.thornvall@gmail.com - 2015-06-28 02:10 -0700
                          Re: Bignumber conversion and arithmetic on unsigned operand pairs using +,-,* now work in anybase. jonas.thornvall@gmail.com - 2015-06-28 02:21 -0700
                        Re: Bignumber conversion and arithmetic on unsigned operand pairs using +,-,* now work in anybase. jonas.thornvall@gmail.com - 2015-06-28 02:24 -0700
                          Re: Bignumber conversion and arithmetic on unsigned operand pairs using +,-,* now work in anybase. "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2015-06-28 17:04 +0200
                            Re: Bignumber conversion and arithmetic on unsigned operand pairs using +,-,* now work in anybase. jonas.thornvall@gmail.com - 2015-06-28 08:23 -0700
                              Re: Bignumber conversion and arithmetic on unsigned operand pairs using +,-,* now work in anybase. "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2015-06-28 17:47 +0200
                              Re: Bignumber conversion and arithmetic on unsigned operand pairs using +,-,* now work in anybase. jonas.thornvall@gmail.com - 2015-06-29 04:12 -0700
                                Re: Bignumber conversion and arithmetic on unsigned operand pairs using +,-,* now work in anybase. Silvio <silvio@internet.com> - 2015-06-29 13:16 +0200
                                  Re: Bignumber conversion and arithmetic on unsigned operand pairs using +,-,* now work in anybase. jonas.thornvall@gmail.com - 2015-06-29 04:30 -0700
                                    Re: Bignumber conversion and arithmetic on unsigned operand pairs using +,-,* now work in anybase. jonas.thornvall@gmail.com - 2015-06-29 04:45 -0700
                                      Re: Bignumber conversion and arithmetic on unsigned operand pairs using +,-,* now work in anybase. Silvio <silvio@internet.com> - 2015-06-29 13:51 +0200
                                        Re: Bignumber conversion and arithmetic on unsigned operand pairs using +,-,* now work in anybase. jonas.thornvall@gmail.com - 2015-06-29 05:08 -0700
                                          Re: Bignumber conversion and arithmetic on unsigned operand pairs using +,-,* now work in anybase. jonas.thornvall@gmail.com - 2015-06-29 05:13 -0700
                                            Re: Bignumber conversion and arithmetic on unsigned operand pairs using +,-,* now work in anybase. jonas.thornvall@gmail.com - 2015-06-29 05:19 -0700
                                              Re: Bignumber conversion and arithmetic on unsigned operand pairs using +,-,* now work in anybase. jonas.thornvall@gmail.com - 2015-06-29 05:27 -0700
                                                Re: Bignumber conversion and arithmetic on unsigned operand pairs using +,-,* now work in anybase. jonas.thornvall@gmail.com - 2015-06-29 05:38 -0700
                                                  Re: Bignumber conversion and arithmetic on unsigned operand pairs using +,-,* now work in anybase. Ben Bacarisse <ben.usenet@bsb.me.uk> - 2015-06-29 14:26 +0100
                                                    Re: Bignumber conversion and arithmetic on unsigned operand pairs using +,-,* now work in anybase. jonas.thornvall@gmail.com - 2015-06-29 06:44 -0700
                                                      Re: Bignumber conversion and arithmetic on unsigned operand pairs using +,-,* now work in anybase. Norman Peelman <npeelman@cfl.rr.com> - 2015-06-29 10:28 -0400
                                                  Re: Bignumber conversion and arithmetic on unsigned operand pairs using +,-,* now work in anybase. jonas.thornvall@gmail.com - 2015-06-29 07:53 -0700
                                      Re: Bignumber conversion and arithmetic on unsigned operand pairs using +,-,* now work in anybase. "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2015-06-29 16:32 +0200
                                        Re: Bignumber conversion and arithmetic on unsigned operand pairs using +,-,* now work in anybase. "Christoph M. Becker" <cmbecker69@arcor.de> - 2015-06-29 16:49 +0200
                                          Re: Bignumber conversion and arithmetic on unsigned operand pairs using +,-,* now work in anybase. "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2015-06-29 17:06 +0200
                                            Re: Bignumber conversion and arithmetic on unsigned operand pairs using +,-,* now work in anybase. jonas.thornvall@gmail.com - 2015-06-29 09:31 -0700
                                              Re: Bignumber conversion and arithmetic on unsigned operand pairs using +,-,* now work in anybase. "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2015-06-29 19:21 +0200
                                                Re: Bignumber conversion and arithmetic on unsigned operand pairs using +,-,* now work in anybase. Tim Streater <timstreater@greenbee.net> - 2015-06-29 18:26 +0100
                                                  Re: Bignumber conversion and arithmetic on unsigned operand pairs using +,-,* now work in anybase. jonas.thornvall@gmail.com - 2015-06-29 10:34 -0700
                                                    Re: Bignumber conversion and arithmetic on unsigned operand pairs using +,-,* now work in anybase. "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2015-06-29 19:52 +0200
                                                      Re: Bignumber conversion and arithmetic on unsigned operand pairs using +,-,* now work in anybase. jonas.thornvall@gmail.com - 2015-06-29 11:08 -0700
                                                        Re: Bignumber conversion and arithmetic on unsigned operand pairs using +,-,* now work in anybase. "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2015-06-29 20:14 +0200
                                                          Re: Bignumber conversion and arithmetic on unsigned operand pairs using +,-,* now work in anybase. Tim Streater <timstreater@greenbee.net> - 2015-06-29 20:45 +0100
                                                        Re: Bignumber conversion and arithmetic on unsigned operand pairs using +,-,* now work in anybase. Ben Bacarisse <ben.usenet@bsb.me.uk> - 2015-06-30 01:00 +0100
                                                          Re: Bignumber conversion and arithmetic on unsigned operand pairs using +,-,* now work in anybase. jonas.thornvall@gmail.com - 2015-06-29 23:35 -0700
                                                          Re: Bignumber conversion and arithmetic on unsigned operand pairs using +,-,* now work in anybase. jonas.thornvall@gmail.com - 2015-06-29 23:37 -0700
                                                          Re: Bignumber conversion and arithmetic on unsigned operand pairs using +,-,* now work in anybase. jonas.thornvall@gmail.com - 2015-06-30 01:50 -0700
                                                            Re: Bignumber conversion and arithmetic on unsigned operand pairs using +,-,* now work in anybase. Ben Bacarisse <ben.usenet@bsb.me.uk> - 2015-06-30 11:11 +0100
                                                              Re: Bignumber conversion and arithmetic on unsigned operand pairs using +,-,* now work in anybase. jonas.thornvall@gmail.com - 2015-07-01 03:12 -0700
                                                              Re: Bignumber conversion and arithmetic on unsigned operand pairs using +,-,* now work in anybase. jonas.thornvall@gmail.com - 2015-07-01 05:06 -0700
                                                                Re: Bignumber conversion and arithmetic on unsigned operand pairs using +,-,* now work in anybase. Ben Bacarisse <ben.usenet@bsb.me.uk> - 2015-07-01 15:24 +0100
                                                                  Re: Bignumber conversion and arithmetic on unsigned operand pairs using +,-,* now work in anybase. jonas.thornvall@gmail.com - 2015-07-01 09:12 -0700
                                          Re: Bignumber conversion and arithmetic on unsigned operand pairs using +,-,* now work in anybase. jonas.thornvall@gmail.com - 2015-06-29 08:28 -0700
                                  Re: Bignumber conversion and arithmetic on unsigned operand pairs using +,-,* now work in anybase. jonas.thornvall@gmail.com - 2015-06-29 05:04 -0700
                                    Re: Bignumber conversion and arithmetic on unsigned operand pairs using +,-,* now work in anybase. Silvio <silvio@internet.com> - 2015-06-29 14:37 +0200
                                Re: Bignumber conversion and arithmetic on unsigned operand pairs using +,-,* now work in anybase. jonas.thornvall@gmail.com - 2015-06-29 04:19 -0700
                                Re: Bignumber conversion and arithmetic on unsigned operand pairs using +,-,* now work in anybase. "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2015-06-29 13:22 +0200
                                Re: Bignumber conversion and arithmetic on unsigned operand pairs using +,-,* now work in anybase. jonas.thornvall@gmail.com - 2015-06-29 04:25 -0700

Page 3 of 5 — ← Prev page 1 2 [3] 4 5  Next page →


#28197

From"Evertjan." <exxjxw.hannivoort@inter.nl.net>
Date2015-06-28 17:04 +0200
Message-ID<XnsA4C7ADBB3AF25eejj99@194.109.6.166>
In reply to#28196
jonas.thornvall@gmail.com wrote on 28 Jun 2015 in comp.lang.javascript:

> Well it isn't broken anymore maybe you should flush the cache of your
> browser. 

I don't use a browser for usenet.

-- 
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)

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


#28198

Fromjonas.thornvall@gmail.com
Date2015-06-28 08:23 -0700
Message-ID<9e383235-5af7-406a-afdc-c0bb0873dc9a@googlegroups.com>
In reply to#28197
Den söndag 28 juni 2015 kl. 17:04:46 UTC+2 skrev Evertjan.:
> jonas.thornvall@gmail.com wrote on 28 Jun 2015 in comp.lang.javascript:
> 
> > Well it isn't broken anymore maybe you should flush the cache of your
> > browser. 
> 
> I don't use a browser for usenet.
> 
> -- 
> Evertjan.
> The Netherlands.
> (Please change the x'es to dots in my emailaddress)

Well i thought you did run the script, i was wrong.

I made one further "?improvement" to increase speed, but somethings goes wrong in the GCD. It do quit faster for values in power range but the GCD do suddenly set wrong value, and i can't quite figure out why. 

Well there is no impromvent until this change also work, but it is a sketch, of an improvement.
http://jt.node365.se/baseconversion6.html

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


#28199

From"Evertjan." <exxjxw.hannivoort@inter.nl.net>
Date2015-06-28 17:47 +0200
Message-ID<XnsA4C7B4F322CCFeejj99@194.109.6.166>
In reply to#28198
jonas.thornvall@gmail.com wrote on 28 Jun 2015 in comp.lang.javascript:

>> > Well it isn't broken anymore maybe you should flush the cache of your
>> > browser. 
>> 
>> I don't use a browser for usenet.
> 
> Well i thought you did run the script,

You must be joking.

> i was wrong.

You were.

-- 
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)

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


#28201

Fromjonas.thornvall@gmail.com
Date2015-06-29 04:12 -0700
Message-ID<e75547f6-d70c-4735-9f6b-b7d712292e97@googlegroups.com>
In reply to#28198
Den söndag 28 juni 2015 kl. 17:23:06 UTC+2 skrev jonas.t...@gmail.com:
> Den söndag 28 juni 2015 kl. 17:04:46 UTC+2 skrev Evertjan.:
> > jonas.thornvall@gmail.com wrote on 28 Jun 2015 in comp.lang.javascript:
> > 
> > > Well it isn't broken anymore maybe you should flush the cache of your
> > > browser. 
> > 
> > I don't use a browser for usenet.
> > 
> > -- 
> > Evertjan.
> > The Netherlands.
> > (Please change the x'es to dots in my emailaddress)
> 
> Well i thought you did run the script, i was wrong.
> 
> I made one further "?improvement" to increase speed, but somethings goes wrong in the GCD. It do quit faster for values in power range but the GCD do suddenly set wrong value, and i can't quite figure out why. 
> 
> Well there is no impromvent until this change also work, but it is a sketch, of an improvement.
> http://jt.node365.se/baseconversion6.html

 if (looptwo==true){
         mycomp=false;
         myremainder = naiveSub(10, decArr, multarr);
         mycomp = arrCompareThree(myremainder,oldigmult[olddigits]);
         if(mycomp==true){break;}
         }
This code somehow manage to change the value of looptwo, but i do not see how.

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


#28202

FromSilvio <silvio@internet.com>
Date2015-06-29 13:16 +0200
Message-ID<5591291f$0$2899$e4fe514c@news.xs4all.nl>
In reply to#28201
On 06/29/2015 01:12 PM, jonas.thornvall@gmail.com wrote:
> Den söndag 28 juni 2015 kl. 17:23:06 UTC+2 skrev jonas.t...@gmail.com:
>> Den söndag 28 juni 2015 kl. 17:04:46 UTC+2 skrev Evertjan.:
>>> jonas.thornvall@gmail.com wrote on 28 Jun 2015 in comp.lang.javascript:
>>>
>>>> Well it isn't broken anymore maybe you should flush the cache of your
>>>> browser.
>>>
>>> I don't use a browser for usenet.
>>>
>>> --
>>> Evertjan.
>>> The Netherlands.
>>> (Please change the x'es to dots in my emailaddress)
>>
>> Well i thought you did run the script, i was wrong.
>>
>> I made one further "?improvement" to increase speed, but somethings goes wrong in the GCD. It do quit faster for values in power range but the GCD do suddenly set wrong value, and i can't quite figure out why.
>>
>> Well there is no impromvent until this change also work, but it is a sketch, of an improvement.
>> http://jt.node365.se/baseconversion6.html
>
>   if (looptwo==true){
>           mycomp=false;
>           myremainder = naiveSub(10, decArr, multarr);
>           mycomp = arrCompareThree(myremainder,oldigmult[olddigits]);
>           if(mycomp==true){break;}
>           }
> This code somehow manage to change the value of looptwo, but i do not see how.
>

Since you persist the stupid habit of using global variables everywhere 
(although being advised not to about a hundred times) my guess would be 
that looptwo is global and either naiveSub or arrCompareThree (or both) 
modify the variable.

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


#28206

Fromjonas.thornvall@gmail.com
Date2015-06-29 04:30 -0700
Message-ID<a8e1a65e-5aa7-4d6f-88c4-1e83ed695a66@googlegroups.com>
In reply to#28202
Den måndag 29 juni 2015 kl. 13:16:53 UTC+2 skrev Silvio:
> On 06/29/2015 01:12 PM, jonas.thornvall@gmail.com wrote:
> > Den söndag 28 juni 2015 kl. 17:23:06 UTC+2 skrev jonas.t...@gmail.com:
> >> Den söndag 28 juni 2015 kl. 17:04:46 UTC+2 skrev Evertjan.:
> >>> jonas.thornvall@gmail.com wrote on 28 Jun 2015 in comp.lang.javascript:
> >>>
> >>>> Well it isn't broken anymore maybe you should flush the cache of your
> >>>> browser.
> >>>
> >>> I don't use a browser for usenet.
> >>>
> >>> --
> >>> Evertjan.
> >>> The Netherlands.
> >>> (Please change the x'es to dots in my emailaddress)
> >>
> >> Well i thought you did run the script, i was wrong.
> >>
> >> I made one further "?improvement" to increase speed, but somethings goes wrong in the GCD. It do quit faster for values in power range but the GCD do suddenly set wrong value, and i can't quite figure out why.
> >>
> >> Well there is no impromvent until this change also work, but it is a sketch, of an improvement.
> >> http://jt.node365.se/baseconversion6.html
> >
> >   if (looptwo==true){
> >           mycomp=false;
> >           myremainder = naiveSub(10, decArr, multarr);
> >           mycomp = arrCompareThree(myremainder,oldigmult[olddigits]);
> >           if(mycomp==true){break;}
> >           }
> > This code somehow manage to change the value of looptwo, but i do not see how.
> >
> 
> Since you persist the stupid habit of using global variables everywhere 
> (although being advised not to about a hundred times) my guess would be 
> that looptwo is global and either naiveSub or arrCompareThree (or both) 
> modify the variable.

But the code within if clause have not been executed at the point the change occure, so how could that be. I have form **printouts** so i can see if that if clause executed before the flop of value in looptwo, it do seem it change because the insertion of the ***if clause itself*** inserted into the tree. 

And that must be something wrong.

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


#28207

Fromjonas.thornvall@gmail.com
Date2015-06-29 04:45 -0700
Message-ID<782a8f27-612b-47eb-897c-7debb99a5ee7@googlegroups.com>
In reply to#28206
Den måndag 29 juni 2015 kl. 13:30:06 UTC+2 skrev jonas.t...@gmail.com:
> Den måndag 29 juni 2015 kl. 13:16:53 UTC+2 skrev Silvio:
> > On 06/29/2015 01:12 PM, jonas.thornvall@gmail.com wrote:
> > > Den söndag 28 juni 2015 kl. 17:23:06 UTC+2 skrev jonas.t...@gmail.com:
> > >> Den söndag 28 juni 2015 kl. 17:04:46 UTC+2 skrev Evertjan.:
> > >>> jonas.thornvall@gmail.com wrote on 28 Jun 2015 in comp.lang.javascript:
> > >>>
> > >>>> Well it isn't broken anymore maybe you should flush the cache of your
> > >>>> browser.
> > >>>
> > >>> I don't use a browser for usenet.
> > >>>
> > >>> --
> > >>> Evertjan.
> > >>> The Netherlands.
> > >>> (Please change the x'es to dots in my emailaddress)
> > >>
> > >> Well i thought you did run the script, i was wrong.
> > >>
> > >> I made one further "?improvement" to increase speed, but somethings goes wrong in the GCD. It do quit faster for values in power range but the GCD do suddenly set wrong value, and i can't quite figure out why.
> > >>
> > >> Well there is no impromvent until this change also work, but it is a sketch, of an improvement.
> > >> http://jt.node365.se/baseconversion6.html
> > >
> > >   if (looptwo==true){
> > >           mycomp=false;
> > >           myremainder = naiveSub(10, decArr, multarr);
> > >           mycomp = arrCompareThree(myremainder,oldigmult[olddigits]);
> > >           if(mycomp==true){break;}
> > >           }
> > > This code somehow manage to change the value of looptwo, but i do not see how.
> > >
> > 
> > Since you persist the stupid habit of using global variables everywhere 
> > (although being advised not to about a hundred times) my guess would be 
> > that looptwo is global and either naiveSub or arrCompareThree (or both) 
> > modify the variable.
> 
> But the code within if clause have not been executed at the point the change occure, so how could that be. I have form **printouts** so i can see if that if clause executed before the flop of value in looptwo, it do seem it change because the insertion of the ***if clause itself*** inserted into the tree. 
> 
> And that must be something wrong.

Could there be limitation upon how a tree structure allowed to look?

 while(olddigits >= 0) {
      while (looptwo == true)
      {
  
         for(y = 0; y < tOne.length; y ++ )
         {
         }
             if (looptwo==true){
        
         if(mycomp==true){break; }
         }
       
         if(found == true)
         {
                break;
         }
         else
         {
         
            if(looptwo == true && mymax != mymin + 1)
            {
          
            }
            else
            {
               if (mymin + 1 == mymax)
               {
              
               }
               else
               {
            
              }
            }
         }

      }

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


#28208

FromSilvio <silvio@internet.com>
Date2015-06-29 13:51 +0200
Message-ID<55913152$0$2853$e4fe514c@news.xs4all.nl>
In reply to#28207
On 06/29/2015 01:45 PM, jonas.thornvall@gmail.com wrote:
> Den måndag 29 juni 2015 kl. 13:30:06 UTC+2 skrev jonas.t...@gmail.com:
>> Den måndag 29 juni 2015 kl. 13:16:53 UTC+2 skrev Silvio:
>>> On 06/29/2015 01:12 PM, jonas.thornvall@gmail.com wrote:
>>>> Den söndag 28 juni 2015 kl. 17:23:06 UTC+2 skrev jonas.t...@gmail.com:
>>>>> Den söndag 28 juni 2015 kl. 17:04:46 UTC+2 skrev Evertjan.:
>>>>>> jonas.thornvall@gmail.com wrote on 28 Jun 2015 in comp.lang.javascript:
>>>>>>
>>>>>>> Well it isn't broken anymore maybe you should flush the cache of your
>>>>>>> browser.
>>>>>>
>>>>>> I don't use a browser for usenet.
>>>>>>
>>>>>> --
>>>>>> Evertjan.
>>>>>> The Netherlands.
>>>>>> (Please change the x'es to dots in my emailaddress)
>>>>>
>>>>> Well i thought you did run the script, i was wrong.
>>>>>
>>>>> I made one further "?improvement" to increase speed, but somethings goes wrong in the GCD. It do quit faster for values in power range but the GCD do suddenly set wrong value, and i can't quite figure out why.
>>>>>
>>>>> Well there is no impromvent until this change also work, but it is a sketch, of an improvement.
>>>>> http://jt.node365.se/baseconversion6.html
>>>>
>>>>    if (looptwo==true){
>>>>            mycomp=false;
>>>>            myremainder = naiveSub(10, decArr, multarr);
>>>>            mycomp = arrCompareThree(myremainder,oldigmult[olddigits]);
>>>>            if(mycomp==true){break;}
>>>>            }
>>>> This code somehow manage to change the value of looptwo, but i do not see how.
>>>>
>>>
>>> Since you persist the stupid habit of using global variables everywhere
>>> (although being advised not to about a hundred times) my guess would be
>>> that looptwo is global and either naiveSub or arrCompareThree (or both)
>>> modify the variable.
>>
>> But the code within if clause have not been executed at the point the change occure, so how could that be. I have form **printouts** so i can see if that if clause executed before the flop of value in looptwo, it do seem it change because the insertion of the ***if clause itself*** inserted into the tree.
>>
>> And that must be something wrong.
>
> Could there be limitation upon how a tree structure allowed to look?
>
>   while(olddigits >= 0) {
>        while (looptwo == true)
>        {
>
>           for(y = 0; y < tOne.length; y ++ )
>           {
>           }
>               if (looptwo==true){
>
>           if(mycomp==true){break; }
>           }
>
>           if(found == true)
>           {
>                  break;
>           }
>           else
>           {
>
>              if(looptwo == true && mymax != mymin + 1)
>              {
>
>              }
>              else
>              {
>                 if (mymin + 1 == mymax)
>                 {
>
>                 }
>                 else
>                 {
>
>                }
>              }
>           }
>
>        }
>

You mean the limitation that braces should match?

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


#28210

Fromjonas.thornvall@gmail.com
Date2015-06-29 05:08 -0700
Message-ID<a5e5d973-77c0-4cae-bef7-f23973e5832e@googlegroups.com>
In reply to#28208
Den måndag 29 juni 2015 kl. 13:52:32 UTC+2 skrev Silvio:
> On 06/29/2015 01:45 PM, jonas.thornvall@gmail.com wrote:
> > Den måndag 29 juni 2015 kl. 13:30:06 UTC+2 skrev jonas.t...@gmail.com:
> >> Den måndag 29 juni 2015 kl. 13:16:53 UTC+2 skrev Silvio:
> >>> On 06/29/2015 01:12 PM, jonas.thornvall@gmail.com wrote:
> >>>> Den söndag 28 juni 2015 kl. 17:23:06 UTC+2 skrev jonas.t...@gmail.com:
> >>>>> Den söndag 28 juni 2015 kl. 17:04:46 UTC+2 skrev Evertjan.:
> >>>>>> jonas.thornvall@gmail.com wrote on 28 Jun 2015 in comp.lang.javascript:
> >>>>>>
> >>>>>>> Well it isn't broken anymore maybe you should flush the cache of your
> >>>>>>> browser.
> >>>>>>
> >>>>>> I don't use a browser for usenet.
> >>>>>>
> >>>>>> --
> >>>>>> Evertjan.
> >>>>>> The Netherlands.
> >>>>>> (Please change the x'es to dots in my emailaddress)
> >>>>>
> >>>>> Well i thought you did run the script, i was wrong.
> >>>>>
> >>>>> I made one further "?improvement" to increase speed, but somethings goes wrong in the GCD. It do quit faster for values in power range but the GCD do suddenly set wrong value, and i can't quite figure out why.
> >>>>>
> >>>>> Well there is no impromvent until this change also work, but it is a sketch, of an improvement.
> >>>>> http://jt.node365.se/baseconversion6.html
> >>>>
> >>>>    if (looptwo==true){
> >>>>            mycomp=false;
> >>>>            myremainder = naiveSub(10, decArr, multarr);
> >>>>            mycomp = arrCompareThree(myremainder,oldigmult[olddigits]);
> >>>>            if(mycomp==true){break;}
> >>>>            }
> >>>> This code somehow manage to change the value of looptwo, but i do not see how.
> >>>>
> >>>
> >>> Since you persist the stupid habit of using global variables everywhere
> >>> (although being advised not to about a hundred times) my guess would be
> >>> that looptwo is global and either naiveSub or arrCompareThree (or both)
> >>> modify the variable.
> >>
> >> But the code within if clause have not been executed at the point the change occure, so how could that be. I have form **printouts** so i can see if that if clause executed before the flop of value in looptwo, it do seem it change because the insertion of the ***if clause itself*** inserted into the tree.
> >>
> >> And that must be something wrong.
> >
> > Could there be limitation upon how a tree structure allowed to look?
> >
> >   while(olddigits >= 0) {
> >        while (looptwo == true)
> >        {
> >
> >           for(y = 0; y < tOne.length; y ++ )
> >           {
> >           }
> >               if (looptwo==true){
> >
> >           if(mycomp==true){break; }
> >           }
> >
> >           if(found == true)
> >           {
> >                  break;
> >           }
> >           else
> >           {
> >
> >              if(looptwo == true && mymax != mymin + 1)
> >              {
> >
> >              }
> >              else
> >              {
> >                 if (mymin + 1 == mymax)
> >                 {
> >
> >                 }
> >                 else
> >                 {
> >
> >                }
> >              }
> >           }
> >
> >        }
> >
> 
> You mean the limitation that braces should match?

I mean limitation to the actual complexity of branching structure in programming languages. I mean that for loop and those breaks isn't exactly beautiful. But it seem logically valid structure.

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


#28211

Fromjonas.thornvall@gmail.com
Date2015-06-29 05:13 -0700
Message-ID<c85be777-3d76-4e40-a1aa-8181ea0975ad@googlegroups.com>
In reply to#28210
Den måndag 29 juni 2015 kl. 14:08:59 UTC+2 skrev jonas.t...@gmail.com:
> Den måndag 29 juni 2015 kl. 13:52:32 UTC+2 skrev Silvio:
> > On 06/29/2015 01:45 PM, jonas.thornvall@gmail.com wrote:
> > > Den måndag 29 juni 2015 kl. 13:30:06 UTC+2 skrev jonas.t...@gmail.com:
> > >> Den måndag 29 juni 2015 kl. 13:16:53 UTC+2 skrev Silvio:
> > >>> On 06/29/2015 01:12 PM, jonas.thornvall@gmail.com wrote:
> > >>>> Den söndag 28 juni 2015 kl. 17:23:06 UTC+2 skrev jonas.t...@gmail.com:
> > >>>>> Den söndag 28 juni 2015 kl. 17:04:46 UTC+2 skrev Evertjan.:
> > >>>>>> jonas.thornvall@gmail.com wrote on 28 Jun 2015 in comp.lang.javascript:
> > >>>>>>
> > >>>>>>> Well it isn't broken anymore maybe you should flush the cache of your
> > >>>>>>> browser.
> > >>>>>>
> > >>>>>> I don't use a browser for usenet.
> > >>>>>>
> > >>>>>> --
> > >>>>>> Evertjan.
> > >>>>>> The Netherlands.
> > >>>>>> (Please change the x'es to dots in my emailaddress)
> > >>>>>
> > >>>>> Well i thought you did run the script, i was wrong.
> > >>>>>
> > >>>>> I made one further "?improvement" to increase speed, but somethings goes wrong in the GCD. It do quit faster for values in power range but the GCD do suddenly set wrong value, and i can't quite figure out why.
> > >>>>>
> > >>>>> Well there is no impromvent until this change also work, but it is a sketch, of an improvement.
> > >>>>> http://jt.node365.se/baseconversion6.html
> > >>>>
> > >>>>    if (looptwo==true){
> > >>>>            mycomp=false;
> > >>>>            myremainder = naiveSub(10, decArr, multarr);
> > >>>>            mycomp = arrCompareThree(myremainder,oldigmult[olddigits]);
> > >>>>            if(mycomp==true){break;}
> > >>>>            }
> > >>>> This code somehow manage to change the value of looptwo, but i do not see how.
> > >>>>
> > >>>
> > >>> Since you persist the stupid habit of using global variables everywhere
> > >>> (although being advised not to about a hundred times) my guess would be
> > >>> that looptwo is global and either naiveSub or arrCompareThree (or both)
> > >>> modify the variable.
> > >>
> > >> But the code within if clause have not been executed at the point the change occure, so how could that be. I have form **printouts** so i can see if that if clause executed before the flop of value in looptwo, it do seem it change because the insertion of the ***if clause itself*** inserted into the tree.
> > >>
> > >> And that must be something wrong.
> > >
> > > Could there be limitation upon how a tree structure allowed to look?
> > >
> > >   while(olddigits >= 0) {
> > >        while (looptwo == true)
> > >        {
> > >
> > >           for(y = 0; y < tOne.length; y ++ )
> > >           {
> > >           }
> > >               if (looptwo==true){
> > >
> > >           if(mycomp==true){break; }
> > >           }
> > >
> > >           if(found == true)
> > >           {
> > >                  break;
> > >           }
> > >           else
> > >           {
> > >
> > >              if(looptwo == true && mymax != mymin + 1)
> > >              {
> > >
> > >              }
> > >              else
> > >              {
> > >                 if (mymin + 1 == mymax)
> > >                 {
> > >
> > >                 }
> > >                 else
> > >                 {
> > >
> > >                }
> > >              }
> > >           }
> > >
> > >        }
> > >
> > 
> > You mean the limitation that braces should match?
> 
> I mean limitation to the actual complexity of branching structure in programming languages. I mean that for loop and those breaks isn't exactly beautiful. But it seem logically valid structure.

BASE 12 NUMBER 143
THIS IS CORRECT
Try digit ->6
2,7 = 2,1 * 6
COMPARE resultmult < decarr TRUE, IF resultmult >= decarr FALSE 
2,7 VS 3,4,1
RETURNED VALUE ->true
MyVal=6  ->MIN=0 ->MAX=12

Try digit ->9
8,0,1 = 2,1 * 9
COMPARE resultmult < decarr TRUE, IF resultmult >= decarr FALSE 
8,0,1 VS 3,4,1
RETURNED VALUE ->true
MyVal=9  ->MIN=6 ->MAX=12

Try digit ->10
0,2,1 = 2,1 * 0,1
COMPARE resultmult < decarr TRUE, IF resultmult >= decarr FALSE 
0,2,1 VS 3,4,1
RETURNED VALUE ->true
MyVal=0,1  ->MIN=9 ->MAX=12

Try digit ->11
2,3,1 = 2,1 * 1,1
COMPARE resultmult < decarr TRUE, IF resultmult >= decarr FALSE 
2,3,1 VS 3,4,1
RETURNED VALUE ->true
MyVal=1,1  ->MIN=10 ->MAX=12

Try digit ->11
2,3,1 = 2,1 * 1,1
COMPARE resultmult < decarr TRUE, IF resultmult >= decarr FALSE 
2,3,1 VS 3,4,1
RETURNED VALUE ->true
MyVal=1,1  ->MIN=11 ->MAX=12
***FOUND NEWDIGIT***  ->11
decArr- multarr  ->3,4,1 - 2,3,1 = 1,1


This is

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


#28212

Fromjonas.thornvall@gmail.com
Date2015-06-29 05:19 -0700
Message-ID<f23d8e55-1074-4eaa-9517-f37e1f7e4d23@googlegroups.com>
In reply to#28211
Den måndag 29 juni 2015 kl. 14:13:56 UTC+2 skrev jonas.t...@gmail.com:
> Den måndag 29 juni 2015 kl. 14:08:59 UTC+2 skrev jonas.t...@gmail.com:
> > Den måndag 29 juni 2015 kl. 13:52:32 UTC+2 skrev Silvio:
> > > On 06/29/2015 01:45 PM, jonas.thornvall@gmail.com wrote:
> > > > Den måndag 29 juni 2015 kl. 13:30:06 UTC+2 skrev jonas.t...@gmail.com:
> > > >> Den måndag 29 juni 2015 kl. 13:16:53 UTC+2 skrev Silvio:
> > > >>> On 06/29/2015 01:12 PM, jonas.thornvall@gmail.com wrote:
> > > >>>> Den söndag 28 juni 2015 kl. 17:23:06 UTC+2 skrev jonas.t...@gmail.com:
> > > >>>>> Den söndag 28 juni 2015 kl. 17:04:46 UTC+2 skrev Evertjan.:
> > > >>>>>> jonas.thornvall@gmail.com wrote on 28 Jun 2015 in comp.lang.javascript:
> > > >>>>>>
> > > >>>>>>> Well it isn't broken anymore maybe you should flush the cache of your
> > > >>>>>>> browser.
> > > >>>>>>
> > > >>>>>> I don't use a browser for usenet.
> > > >>>>>>
> > > >>>>>> --
> > > >>>>>> Evertjan.
> > > >>>>>> The Netherlands.
> > > >>>>>> (Please change the x'es to dots in my emailaddress)
> > > >>>>>
> > > >>>>> Well i thought you did run the script, i was wrong.
> > > >>>>>
> > > >>>>> I made one further "?improvement" to increase speed, but somethings goes wrong in the GCD. It do quit faster for values in power range but the GCD do suddenly set wrong value, and i can't quite figure out why.
> > > >>>>>
> > > >>>>> Well there is no impromvent until this change also work, but it is a sketch, of an improvement.
> > > >>>>> http://jt.node365.se/baseconversion6.html
> > > >>>>
> > > >>>>    if (looptwo==true){
> > > >>>>            mycomp=false;
> > > >>>>            myremainder = naiveSub(10, decArr, multarr);
> > > >>>>            mycomp = arrCompareThree(myremainder,oldigmult[olddigits]);
> > > >>>>            if(mycomp==true){break;}
> > > >>>>            }
> > > >>>> This code somehow manage to change the value of looptwo, but i do not see how.
> > > >>>>
> > > >>>
> > > >>> Since you persist the stupid habit of using global variables everywhere
> > > >>> (although being advised not to about a hundred times) my guess would be
> > > >>> that looptwo is global and either naiveSub or arrCompareThree (or both)
> > > >>> modify the variable.
> > > >>
> > > >> But the code within if clause have not been executed at the point the change occure, so how could that be. I have form **printouts** so i can see if that if clause executed before the flop of value in looptwo, it do seem it change because the insertion of the ***if clause itself*** inserted into the tree.
> > > >>
> > > >> And that must be something wrong.
> > > >
> > > > Could there be limitation upon how a tree structure allowed to look?
> > > >
> > > >   while(olddigits >= 0) {
> > > >        while (looptwo == true)
> > > >        {
> > > >
> > > >           for(y = 0; y < tOne.length; y ++ )
> > > >           {
> > > >           }
> > > >               if (looptwo==true){
> > > >
> > > >           if(mycomp==true){break; }
> > > >           }
> > > >
> > > >           if(found == true)
> > > >           {
> > > >                  break;
> > > >           }
> > > >           else
> > > >           {
> > > >
> > > >              if(looptwo == true && mymax != mymin + 1)
> > > >              {
> > > >
> > > >              }
> > > >              else
> > > >              {
> > > >                 if (mymin + 1 == mymax)
> > > >                 {
> > > >
> > > >                 }
> > > >                 else
> > > >                 {
> > > >
> > > >                }
> > > >              }
> > > >           }
> > > >
> > > >        }
> > > >
> > > 
> > > You mean the limitation that braces should match?
> > 
> > I mean limitation to the actual complexity of branching structure in programming languages. I mean that for loop and those breaks isn't exactly beautiful. But it seem logically valid structure.
> 
> BASE 12 NUMBER 143
> THIS IS CORRECT
> Try digit ->6
> 2,7 = 2,1 * 6
> COMPARE resultmult < decarr TRUE, IF resultmult >= decarr FALSE 
> 2,7 VS 3,4,1
> RETURNED VALUE ->true
> MyVal=6  ->MIN=0 ->MAX=12
> 
> Try digit ->9
> 8,0,1 = 2,1 * 9
> COMPARE resultmult < decarr TRUE, IF resultmult >= decarr FALSE 
> 8,0,1 VS 3,4,1
> RETURNED VALUE ->true
> MyVal=9  ->MIN=6 ->MAX=12
> 
> Try digit ->10
> 0,2,1 = 2,1 * 0,1
> COMPARE resultmult < decarr TRUE, IF resultmult >= decarr FALSE 
> 0,2,1 VS 3,4,1
> RETURNED VALUE ->true
> MyVal=0,1  ->MIN=9 ->MAX=12
> 
> Try digit ->11
> 2,3,1 = 2,1 * 1,1
> COMPARE resultmult < decarr TRUE, IF resultmult >= decarr FALSE 
> 2,3,1 VS 3,4,1
> RETURNED VALUE ->true
> MyVal=1,1  ->MIN=10 ->MAX=12
> 
> Try digit ->11
> 2,3,1 = 2,1 * 1,1
> COMPARE resultmult < decarr TRUE, IF resultmult >= decarr FALSE 
> 2,3,1 VS 3,4,1
> RETURNED VALUE ->true
> MyVal=1,1  ->MIN=11 ->MAX=12
> ***FOUND NEWDIGIT***  ->11
> decArr- multarr  ->3,4,1 - 2,3,1 = 1,1
> 
> 
> This is

Found the error in the multiplication

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


#28213

Fromjonas.thornvall@gmail.com
Date2015-06-29 05:27 -0700
Message-ID<9c40dc70-b2e2-499c-801e-d9c5125c18e8@googlegroups.com>
In reply to#28212
Den måndag 29 juni 2015 kl. 14:20:02 UTC+2 skrev jonas.t...@gmail.com:
> Den måndag 29 juni 2015 kl. 14:13:56 UTC+2 skrev jonas.t...@gmail.com:
> > Den måndag 29 juni 2015 kl. 14:08:59 UTC+2 skrev jonas.t...@gmail.com:
> > > Den måndag 29 juni 2015 kl. 13:52:32 UTC+2 skrev Silvio:
> > > > On 06/29/2015 01:45 PM, jonas.thornvall@gmail.com wrote:
> > > > > Den måndag 29 juni 2015 kl. 13:30:06 UTC+2 skrev jonas.t...@gmail.com:
> > > > >> Den måndag 29 juni 2015 kl. 13:16:53 UTC+2 skrev Silvio:
> > > > >>> On 06/29/2015 01:12 PM, jonas.thornvall@gmail.com wrote:
> > > > >>>> Den söndag 28 juni 2015 kl. 17:23:06 UTC+2 skrev jonas.t...@gmail.com:
> > > > >>>>> Den söndag 28 juni 2015 kl. 17:04:46 UTC+2 skrev Evertjan.:
> > > > >>>>>> jonas.thornvall@gmail.com wrote on 28 Jun 2015 in comp.lang.javascript:
> > > > >>>>>>
> > > > >>>>>>> Well it isn't broken anymore maybe you should flush the cache of your
> > > > >>>>>>> browser.
> > > > >>>>>>
> > > > >>>>>> I don't use a browser for usenet.
> > > > >>>>>>
> > > > >>>>>> --
> > > > >>>>>> Evertjan.
> > > > >>>>>> The Netherlands.
> > > > >>>>>> (Please change the x'es to dots in my emailaddress)
> > > > >>>>>
> > > > >>>>> Well i thought you did run the script, i was wrong.
> > > > >>>>>
> > > > >>>>> I made one further "?improvement" to increase speed, but somethings goes wrong in the GCD. It do quit faster for values in power range but the GCD do suddenly set wrong value, and i can't quite figure out why.
> > > > >>>>>
> > > > >>>>> Well there is no impromvent until this change also work, but it is a sketch, of an improvement.
> > > > >>>>> http://jt.node365.se/baseconversion6.html
> > > > >>>>
> > > > >>>>    if (looptwo==true){
> > > > >>>>            mycomp=false;
> > > > >>>>            myremainder = naiveSub(10, decArr, multarr);
> > > > >>>>            mycomp = arrCompareThree(myremainder,oldigmult[olddigits]);
> > > > >>>>            if(mycomp==true){break;}
> > > > >>>>            }
> > > > >>>> This code somehow manage to change the value of looptwo, but i do not see how.
> > > > >>>>
> > > > >>>
> > > > >>> Since you persist the stupid habit of using global variables everywhere
> > > > >>> (although being advised not to about a hundred times) my guess would be
> > > > >>> that looptwo is global and either naiveSub or arrCompareThree (or both)
> > > > >>> modify the variable.
> > > > >>
> > > > >> But the code within if clause have not been executed at the point the change occure, so how could that be. I have form **printouts** so i can see if that if clause executed before the flop of value in looptwo, it do seem it change because the insertion of the ***if clause itself*** inserted into the tree.
> > > > >>
> > > > >> And that must be something wrong.
> > > > >
> > > > > Could there be limitation upon how a tree structure allowed to look?
> > > > >
> > > > >   while(olddigits >= 0) {
> > > > >        while (looptwo == true)
> > > > >        {
> > > > >
> > > > >           for(y = 0; y < tOne.length; y ++ )
> > > > >           {
> > > > >           }
> > > > >               if (looptwo==true){
> > > > >
> > > > >           if(mycomp==true){break; }
> > > > >           }
> > > > >
> > > > >           if(found == true)
> > > > >           {
> > > > >                  break;
> > > > >           }
> > > > >           else
> > > > >           {
> > > > >
> > > > >              if(looptwo == true && mymax != mymin + 1)
> > > > >              {
> > > > >
> > > > >              }
> > > > >              else
> > > > >              {
> > > > >                 if (mymin + 1 == mymax)
> > > > >                 {
> > > > >
> > > > >                 }
> > > > >                 else
> > > > >                 {
> > > > >
> > > > >                }
> > > > >              }
> > > > >           }
> > > > >
> > > > >        }
> > > > >
> > > > 
> > > > You mean the limitation that braces should match?
> > > 
> > > I mean limitation to the actual complexity of branching structure in programming languages. I mean that for loop and those breaks isn't exactly beautiful. But it seem logically valid structure.
> > 
> > BASE 12 NUMBER 143
> > THIS IS CORRECT
> > Try digit ->6
> > 2,7 = 2,1 * 6
> > COMPARE resultmult < decarr TRUE, IF resultmult >= decarr FALSE 
> > 2,7 VS 3,4,1
> > RETURNED VALUE ->true
> > MyVal=6  ->MIN=0 ->MAX=12
> > 
> > Try digit ->9
> > 8,0,1 = 2,1 * 9
> > COMPARE resultmult < decarr TRUE, IF resultmult >= decarr FALSE 
> > 8,0,1 VS 3,4,1
> > RETURNED VALUE ->true
> > MyVal=9  ->MIN=6 ->MAX=12
> > 
> > Try digit ->10
> > 0,2,1 = 2,1 * 0,1
> > COMPARE resultmult < decarr TRUE, IF resultmult >= decarr FALSE 
> > 0,2,1 VS 3,4,1
> > RETURNED VALUE ->true
> > MyVal=0,1  ->MIN=9 ->MAX=12
> > 
> > Try digit ->11
> > 2,3,1 = 2,1 * 1,1
> > COMPARE resultmult < decarr TRUE, IF resultmult >= decarr FALSE 
> > 2,3,1 VS 3,4,1
> > RETURNED VALUE ->true
> > MyVal=1,1  ->MIN=10 ->MAX=12
> > 
> > Try digit ->11
> > 2,3,1 = 2,1 * 1,1
> > COMPARE resultmult < decarr TRUE, IF resultmult >= decarr FALSE 
> > 2,3,1 VS 3,4,1
> > RETURNED VALUE ->true
> > MyVal=1,1  ->MIN=11 ->MAX=12
> > ***FOUND NEWDIGIT***  ->11
> > decArr- multarr  ->3,4,1 - 2,3,1 = 1,1
> > 
> > 
> > This is
> 
> Found the error in the multiplication

The array decArr somehow have changed.

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


#28215

Fromjonas.thornvall@gmail.com
Date2015-06-29 05:38 -0700
Message-ID<0e912ba8-4e9f-4b83-85e6-167af56fe592@googlegroups.com>
In reply to#28213
Den måndag 29 juni 2015 kl. 14:27:22 UTC+2 skrev jonas.t...@gmail.com:
> Den måndag 29 juni 2015 kl. 14:20:02 UTC+2 skrev jonas.t...@gmail.com:
> > Den måndag 29 juni 2015 kl. 14:13:56 UTC+2 skrev jonas.t...@gmail.com:
> > > Den måndag 29 juni 2015 kl. 14:08:59 UTC+2 skrev jonas.t...@gmail.com:
> > > > Den måndag 29 juni 2015 kl. 13:52:32 UTC+2 skrev Silvio:
> > > > > On 06/29/2015 01:45 PM, jonas.thornvall@gmail.com wrote:
> > > > > > Den måndag 29 juni 2015 kl. 13:30:06 UTC+2 skrev jonas.t...@gmail.com:
> > > > > >> Den måndag 29 juni 2015 kl. 13:16:53 UTC+2 skrev Silvio:
> > > > > >>> On 06/29/2015 01:12 PM, jonas.thornvall@gmail.com wrote:
> > > > > >>>> Den söndag 28 juni 2015 kl. 17:23:06 UTC+2 skrev jonas.t...@gmail.com:
> > > > > >>>>> Den söndag 28 juni 2015 kl. 17:04:46 UTC+2 skrev Evertjan.:
> > > > > >>>>>> jonas.thornvall@gmail.com wrote on 28 Jun 2015 in comp.lang.javascript:
> > > > > >>>>>>
> > > > > >>>>>>> Well it isn't broken anymore maybe you should flush the cache of your
> > > > > >>>>>>> browser.
> > > > > >>>>>>
> > > > > >>>>>> I don't use a browser for usenet.
> > > > > >>>>>>
> > > > > >>>>>> --
> > > > > >>>>>> Evertjan.
> > > > > >>>>>> The Netherlands.
> > > > > >>>>>> (Please change the x'es to dots in my emailaddress)
> > > > > >>>>>
> > > > > >>>>> Well i thought you did run the script, i was wrong.
> > > > > >>>>>
> > > > > >>>>> I made one further "?improvement" to increase speed, but somethings goes wrong in the GCD. It do quit faster for values in power range but the GCD do suddenly set wrong value, and i can't quite figure out why.
> > > > > >>>>>
> > > > > >>>>> Well there is no impromvent until this change also work, but it is a sketch, of an improvement.
> > > > > >>>>> http://jt.node365.se/baseconversion6.html
> > > > > >>>>
> > > > > >>>>    if (looptwo==true){
> > > > > >>>>            mycomp=false;
> > > > > >>>>            myremainder = naiveSub(10, decArr, multarr);
> > > > > >>>>            mycomp = arrCompareThree(myremainder,oldigmult[olddigits]);
> > > > > >>>>            if(mycomp==true){break;}
> > > > > >>>>            }
> > > > > >>>> This code somehow manage to change the value of looptwo, but i do not see how.
> > > > > >>>>
> > > > > >>>
> > > > > >>> Since you persist the stupid habit of using global variables everywhere
> > > > > >>> (although being advised not to about a hundred times) my guess would be
> > > > > >>> that looptwo is global and either naiveSub or arrCompareThree (or both)
> > > > > >>> modify the variable.
> > > > > >>
> > > > > >> But the code within if clause have not been executed at the point the change occure, so how could that be. I have form **printouts** so i can see if that if clause executed before the flop of value in looptwo, it do seem it change because the insertion of the ***if clause itself*** inserted into the tree.
> > > > > >>
> > > > > >> And that must be something wrong.
> > > > > >
> > > > > > Could there be limitation upon how a tree structure allowed to look?
> > > > > >
> > > > > >   while(olddigits >= 0) {
> > > > > >        while (looptwo == true)
> > > > > >        {
> > > > > >
> > > > > >           for(y = 0; y < tOne.length; y ++ )
> > > > > >           {
> > > > > >           }
> > > > > >               if (looptwo==true){
> > > > > >
> > > > > >           if(mycomp==true){break; }
> > > > > >           }
> > > > > >
> > > > > >           if(found == true)
> > > > > >           {
> > > > > >                  break;
> > > > > >           }
> > > > > >           else
> > > > > >           {
> > > > > >
> > > > > >              if(looptwo == true && mymax != mymin + 1)
> > > > > >              {
> > > > > >
> > > > > >              }
> > > > > >              else
> > > > > >              {
> > > > > >                 if (mymin + 1 == mymax)
> > > > > >                 {
> > > > > >
> > > > > >                 }
> > > > > >                 else
> > > > > >                 {
> > > > > >
> > > > > >                }
> > > > > >              }
> > > > > >           }
> > > > > >
> > > > > >        }
> > > > > >
> > > > > 
> > > > > You mean the limitation that braces should match?
> > > > 
> > > > I mean limitation to the actual complexity of branching structure in programming languages. I mean that for loop and those breaks isn't exactly beautiful. But it seem logically valid structure.
> > > 
> > > BASE 12 NUMBER 143
> > > THIS IS CORRECT
> > > Try digit ->6
> > > 2,7 = 2,1 * 6
> > > COMPARE resultmult < decarr TRUE, IF resultmult >= decarr FALSE 
> > > 2,7 VS 3,4,1
> > > RETURNED VALUE ->true
> > > MyVal=6  ->MIN=0 ->MAX=12
> > > 
> > > Try digit ->9
> > > 8,0,1 = 2,1 * 9
> > > COMPARE resultmult < decarr TRUE, IF resultmult >= decarr FALSE 
> > > 8,0,1 VS 3,4,1
> > > RETURNED VALUE ->true
> > > MyVal=9  ->MIN=6 ->MAX=12
> > > 
> > > Try digit ->10
> > > 0,2,1 = 2,1 * 0,1
> > > COMPARE resultmult < decarr TRUE, IF resultmult >= decarr FALSE 
> > > 0,2,1 VS 3,4,1
> > > RETURNED VALUE ->true
> > > MyVal=0,1  ->MIN=9 ->MAX=12
> > > 
> > > Try digit ->11
> > > 2,3,1 = 2,1 * 1,1
> > > COMPARE resultmult < decarr TRUE, IF resultmult >= decarr FALSE 
> > > 2,3,1 VS 3,4,1
> > > RETURNED VALUE ->true
> > > MyVal=1,1  ->MIN=10 ->MAX=12
> > > 
> > > Try digit ->11
> > > 2,3,1 = 2,1 * 1,1
> > > COMPARE resultmult < decarr TRUE, IF resultmult >= decarr FALSE 
> > > 2,3,1 VS 3,4,1
> > > RETURNED VALUE ->true
> > > MyVal=1,1  ->MIN=11 ->MAX=12
> > > ***FOUND NEWDIGIT***  ->11
> > > decArr- multarr  ->3,4,1 - 2,3,1 = 1,1
> > > 
> > > 
> > > This is
> > 
> > Found the error in the multiplication
> 
> The array decArr somehow have changed.

Something with the subtraction.

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


#28216

FromBen Bacarisse <ben.usenet@bsb.me.uk>
Date2015-06-29 14:26 +0100
Message-ID<87pp4ed4t2.fsf@bsb.me.uk>
In reply to#28215
jonas.thornvall@gmail.com writes:
<snip more than 150 quoted lines>
> Something with the subtraction.

Why do you think anyone wants a running commentary on your tracking down
bugs?  Why quote 150 lines just to add this latest inconclusive remark?

Maybe you don't care what people here think but if you want keep the
possibility of getting advice here open I'd suggest you post fewer, more
substantial summaries.

-- 
Ben.

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


#28218

Fromjonas.thornvall@gmail.com
Date2015-06-29 06:44 -0700
Message-ID<dce2dd6d-03a4-419c-a272-73eea35fe376@googlegroups.com>
In reply to#28216
Den måndag 29 juni 2015 kl. 15:26:06 UTC+2 skrev Ben Bacarisse:
> jonas.thornvall@gmail.com writes:
> <snip more than 150 quoted lines>
> > Something with the subtraction.
> 
> Why do you think anyone wants a running commentary on your tracking down
> bugs?  Why quote 150 lines just to add this latest inconclusive remark?
> 
> Maybe you don't care what people here think but if you want keep the
> possibility of getting advice here open I'd suggest you post fewer, more
> substantial summaries.
> 
> -- 
> Ben.

I advocate that everyone should use usenet as it suits them, for me it serves as a sketchboard. And as i understand it is very easy fot those dislike my posting style, to simply hide my posts using a newsreader. Maybe it is even possible in google groups what do i know.

I suggest that those interested in the topic keep on reading, and those who dislike my posting simply killfile me. The baseconversion and arithmetic speed will improve, maybe even the codingstyle who knows. Maybe there will be square number systems coming up, there certainly will be fractional partitioning in the bases and signed numbers. 

The speed of the calculations will increase.

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


#28219

FromNorman Peelman <npeelman@cfl.rr.com>
Date2015-06-29 10:28 -0400
Message-ID<mmrkkl$qpf$1@dont-email.me>
In reply to#28218
On 06/29/2015 09:44 AM, jonas.thornvall@gmail.com wrote:
> Den måndag 29 juni 2015 kl. 15:26:06 UTC+2 skrev Ben Bacarisse:
>> jonas.thornvall@gmail.com writes:
>> <snip more than 150 quoted lines>
>>> Something with the subtraction.
>>
>> Why do you think anyone wants a running commentary on your tracking down
>> bugs?  Why quote 150 lines just to add this latest inconclusive remark?
>>
>> Maybe you don't care what people here think but if you want keep the
>> possibility of getting advice here open I'd suggest you post fewer, more
>> substantial summaries.
>>
>> --
>> Ben.
>
> I advocate that everyone should use usenet as it suits them, for me it serves as a sketchboard. And as i understand it is very easy fot those dislike my posting style, to simply hide my posts using a newsreader. Maybe it is even possible in google groups what do i know.
>
> I suggest that those interested in the topic keep on reading, and those who dislike my posting simply killfile me. The baseconversion and arithmetic speed will improve, maybe even the codingstyle who knows. Maybe there will be square number systems coming up, there certainly will be fractional partitioning in the bases and signed numbers.
>
> The speed of the calculations will increase.
>


   Not as fast as peoples willingness to help you...



-- 
Norman
Registered Linux user #461062
AMD64X2 6400+ Ubuntu 10.04 64bit

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


#28222

Fromjonas.thornvall@gmail.com
Date2015-06-29 07:53 -0700
Message-ID<7732a70c-9008-4121-a371-22933ad124f9@googlegroups.com>
In reply to#28215
Den måndag 29 juni 2015 kl. 14:38:57 UTC+2 skrev jonas.t...@gmail.com:
> Den måndag 29 juni 2015 kl. 14:27:22 UTC+2 skrev jonas.t...@gmail.com:
> > Den måndag 29 juni 2015 kl. 14:20:02 UTC+2 skrev jonas.t...@gmail.com:
> > > Den måndag 29 juni 2015 kl. 14:13:56 UTC+2 skrev jonas.t...@gmail.com:
> > > > Den måndag 29 juni 2015 kl. 14:08:59 UTC+2 skrev jonas.t...@gmail.com:
> > > > > Den måndag 29 juni 2015 kl. 13:52:32 UTC+2 skrev Silvio:
> > > > > > On 06/29/2015 01:45 PM, jonas.thornvall@gmail.com wrote:
> > > > > > > Den måndag 29 juni 2015 kl. 13:30:06 UTC+2 skrev jonas.t...@gmail.com:
> > > > > > >> Den måndag 29 juni 2015 kl. 13:16:53 UTC+2 skrev Silvio:
> > > > > > >>> On 06/29/2015 01:12 PM, jonas.thornvall@gmail.com wrote:
> > > > > > >>>> Den söndag 28 juni 2015 kl. 17:23:06 UTC+2 skrev jonas.t...@gmail.com:
> > > > > > >>>>> Den söndag 28 juni 2015 kl. 17:04:46 UTC+2 skrev Evertjan.:
> > > > > > >>>>>> jonas.thornvall@gmail.com wrote on 28 Jun 2015 in comp.lang.javascript:
> > > > > > >>>>>>
> > > > > > >>>>>>> Well it isn't broken anymore maybe you should flush the cache of your
> > > > > > >>>>>>> browser.
> > > > > > >>>>>>
> > > > > > >>>>>> I don't use a browser for usenet.
> > > > > > >>>>>>
> > > > > > >>>>>> --
> > > > > > >>>>>> Evertjan.
> > > > > > >>>>>> The Netherlands.
> > > > > > >>>>>> (Please change the x'es to dots in my emailaddress)
> > > > > > >>>>>
> > > > > > >>>>> Well i thought you did run the script, i was wrong.
> > > > > > >>>>>
> > > > > > >>>>> I made one further "?improvement" to increase speed, but somethings goes wrong in the GCD. It do quit faster for values in power range but the GCD do suddenly set wrong value, and i can't quite figure out why.
> > > > > > >>>>>
> > > > > > >>>>> Well there is no impromvent until this change also work, but it is a sketch, of an improvement.
> > > > > > >>>>> http://jt.node365.se/baseconversion6.html
> > > > > > >>>>
> > > > > > >>>>    if (looptwo==true){
> > > > > > >>>>            mycomp=false;
> > > > > > >>>>            myremainder = naiveSub(10, decArr, multarr);
> > > > > > >>>>            mycomp = arrCompareThree(myremainder,oldigmult[olddigits]);
> > > > > > >>>>            if(mycomp==true){break;}
> > > > > > >>>>            }
> > > > > > >>>> This code somehow manage to change the value of looptwo, but i do not see how.
> > > > > > >>>>
> > > > > > >>>
> > > > > > >>> Since you persist the stupid habit of using global variables everywhere
> > > > > > >>> (although being advised not to about a hundred times) my guess would be
> > > > > > >>> that looptwo is global and either naiveSub or arrCompareThree (or both)
> > > > > > >>> modify the variable.
> > > > > > >>
> > > > > > >> But the code within if clause have not been executed at the point the change occure, so how could that be. I have form **printouts** so i can see if that if clause executed before the flop of value in looptwo, it do seem it change because the insertion of the ***if clause itself*** inserted into the tree.
> > > > > > >>
> > > > > > >> And that must be something wrong.
> > > > > > >
> > > > > > > Could there be limitation upon how a tree structure allowed to look?
> > > > > > >
> > > > > > >   while(olddigits >= 0) {
> > > > > > >        while (looptwo == true)
> > > > > > >        {
> > > > > > >
> > > > > > >           for(y = 0; y < tOne.length; y ++ )
> > > > > > >           {
> > > > > > >           }
> > > > > > >               if (looptwo==true){
> > > > > > >
> > > > > > >           if(mycomp==true){break; }
> > > > > > >           }
> > > > > > >
> > > > > > >           if(found == true)
> > > > > > >           {
> > > > > > >                  break;
> > > > > > >           }
> > > > > > >           else
> > > > > > >           {
> > > > > > >
> > > > > > >              if(looptwo == true && mymax != mymin + 1)
> > > > > > >              {
> > > > > > >
> > > > > > >              }
> > > > > > >              else
> > > > > > >              {
> > > > > > >                 if (mymin + 1 == mymax)
> > > > > > >                 {
> > > > > > >
> > > > > > >                 }
> > > > > > >                 else
> > > > > > >                 {
> > > > > > >
> > > > > > >                }
> > > > > > >              }
> > > > > > >           }
> > > > > > >
> > > > > > >        }
> > > > > > >
> > > > > > 
> > > > > > You mean the limitation that braces should match?
> > > > > 
> > > > > I mean limitation to the actual complexity of branching structure in programming languages. I mean that for loop and those breaks isn't exactly beautiful. But it seem logically valid structure.
> > > > 
> > > > BASE 12 NUMBER 143
> > > > THIS IS CORRECT
> > > > Try digit ->6
> > > > 2,7 = 2,1 * 6
> > > > COMPARE resultmult < decarr TRUE, IF resultmult >= decarr FALSE 
> > > > 2,7 VS 3,4,1
> > > > RETURNED VALUE ->true
> > > > MyVal=6  ->MIN=0 ->MAX=12
> > > > 
> > > > Try digit ->9
> > > > 8,0,1 = 2,1 * 9
> > > > COMPARE resultmult < decarr TRUE, IF resultmult >= decarr FALSE 
> > > > 8,0,1 VS 3,4,1
> > > > RETURNED VALUE ->true
> > > > MyVal=9  ->MIN=6 ->MAX=12
> > > > 
> > > > Try digit ->10
> > > > 0,2,1 = 2,1 * 0,1
> > > > COMPARE resultmult < decarr TRUE, IF resultmult >= decarr FALSE 
> > > > 0,2,1 VS 3,4,1
> > > > RETURNED VALUE ->true
> > > > MyVal=0,1  ->MIN=9 ->MAX=12
> > > > 
> > > > Try digit ->11
> > > > 2,3,1 = 2,1 * 1,1
> > > > COMPARE resultmult < decarr TRUE, IF resultmult >= decarr FALSE 
> > > > 2,3,1 VS 3,4,1
> > > > RETURNED VALUE ->true
> > > > MyVal=1,1  ->MIN=10 ->MAX=12
> > > > 
> > > > Try digit ->11
> > > > 2,3,1 = 2,1 * 1,1
> > > > COMPARE resultmult < decarr TRUE, IF resultmult >= decarr FALSE 
> > > > 2,3,1 VS 3,4,1
> > > > RETURNED VALUE ->true
> > > > MyVal=1,1  ->MIN=11 ->MAX=12
> > > > ***FOUND NEWDIGIT***  ->11
> > > > decArr- multarr  ->3,4,1 - 2,3,1 = 1,1
> > > > 
> > > > 
> > > > This is
> > > 
> > > Found the error in the multiplication
> > 
> > The array decArr somehow have changed.
> 
> Something with the subtraction.

Fixed it sort off. Well more of stepped around the problem, i can not see how the local array variables in subtraction can affect the values in decArr. Maybe i simply do not understand how Javascript handles variables. So i sliced decArr value to a copy.

http://jt.node365.se/baseconversion7.html

<html lang="en"><head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8"><script language="Javascript">

/* CONVERT A DECIMAL NUMBER INTO ANYBASE */

function newbase(decArr, base)
{
   tempBase = base.toString();
   baseArr = tempBase.split("").reverse();
   digRes = [];
   resultmult = [];
   digit = 0;
   oldigmult = [];
   resultmult[0] = 1;
   convArr = []
   digits = 0;
   for(i = 0; i < baseArr.length; i ++ )
   {
      baseArr[i] = parseInt(baseArr[i]);
   }
   for(i = 0; i < decArr.length; i ++ )
   {
      decArr[i] = parseInt(decArr[i]);
   }
   loop = true;
   document.calc.trash.value += "\n*LOOP USE BASE FIND CLOSEST EXPONENT THAT IS LESS THAN NUMBER* \n";
   while(loop == true)
   {
      oldigmult[digits] = resultmult;
      olddigits = digits;
      orderArrayMult(10, baseArr, resultmult);
      loop = arrCompareTwo(resultmult, decArr);
      document.calc.trash.value += "RETURNED VALUE ->" + loop + "\n";
      digits ++ ;
   }

   while(olddigits >= 0)
   {
      resultmult = [];
      counterArr = [];
      looptwo = true;
      mymin = 0;
      mymax = base;
      myval = parseInt(base / 2);
      while (looptwo == true)
      {
         document.calc.trash.value += "\nTry digit ->" + myval + "\n";
         tOne = myval.toString();
         myDig = [];
         for(y = 0; y < tOne.length; y ++ )
         {
            tTwo = tOne.charAt(y);
            myDig[y] = parseInt(tTwo);
         }
         myDig.reverse();
         orderArrayMult(10, myDig, oldigmult[olddigits]);
         
         multarr = resultmult.slice();
         looptwo = arrCompareTwo(resultmult, decArr);
            
        if (looptwo==true && olddigits>0){
        mycomp=false;
        unecessary=decArr.slice();
        myremainder = naiveSub(10, unecessary, multarr);
        //document.write(decArr);p.stop();
        mycomp = arrCompareThree(myremainder,oldigmult[olddigits]);
        if(mycomp==true){ document.calc.trash.value+="XXXXXXXX\n";break; }
         }
       
         if(found == true)
         {
            convArr[olddigits] = myDig;
            break;
         }
         else
         {
            document.calc.trash.value += "RETURNED VALUE ->" + looptwo + "\n";
            document.calc.trash.value += "MyVal=" + myDig + "  ->MIN=" + mymin + " ->MAX=" + mymax + "\n";
            if(looptwo == true && mymax != mymin + 1)
            {
               mymin = myval;
               myval = mymin + ((mymax - mymin) / 2);
               myval = parseInt(myval);
            }
            else
            {
               if (mymin + 1 == mymax)
               {
                  looptwo = false;
               }
               else
               {
                  looptwo = true;
                  mymax = myval;
                  myval = mymax - ((mymax - mymin) / 2);
                  myval = parseInt(myval);
               }
            }
         }

      }

      myVar = myDig.join("");
      document.calc.trash.value += "***FOUND NEWDIGIT***  ->" + myVar + "\n";
      convArr[olddigits] = myVar;
      olddigits -- ;
      document.calc.trash.value += "decArr- multarr  ->" + decArr + " - " + multarr;
      decArr = naiveSub(10, decArr, multarr);
      document.calc.trash.value += " = " + decArr + "\n";
      checkifzero = decArr.join("");
      testValZero = parseInt(checkifzero);
      if(testValZero <= 0)  {  break; }
   }
   for(j = olddigits; j >= 0; j -- )
   {
      convArr[j] = 0;
   }
   return convArr;
}

function arrCompareThree(A, B)
{
   found = false;
   document.calc.trash.value += "COMPARE resultmult < decarr TRUE, IF resultmult >= decarr FALSE \n" + A + " VS " + B + "\n";
   var AA = A.length;
   var BB = B.length;
   if(AA > BB) return false;
   if(AA < BB) return true;
   // AA = BB, compare indexes from biggest to smallest.
   for(i = AA - 1; i >= 0; i -- )
   {
      if(A[i] < B[i]) return true;
      if(A[i] > B[i]) return false;
   }
   
   found = true;
   return false;
}


/* COMPARE SIZE OF TWO ARRAYS, IF A < B RETURN TRUE, IF B >= A RETURN FALSE */

function arrCompareTwo(A, B)
{
   found = false;
   document.calc.trash.value += "COMPARE resultmult < decarr TRUE, IF resultmult >= decarr FALSE \n" + A + " VS " + B + "\n";
   var AA = A.length;
   var BB = B.length;
   if(AA > BB) return false;
   if(AA < BB) return true;
   // AA = BB, compare indexes from biggest to smallest.
   for(i = AA - 1; i >= 0; i -- )
   {
      if(A[i] < B[i]) return true;
      if(A[i] > B[i]) return false;
   }
   
   found = true;
   return true;
}

/* COMPARE SIZE OF TWO ARRAYS, IF A < B RETURN TRUE, IF B >= A RETURN FALSE */

function lessThan(A, B)
{
   var AA = A.length;
   var BB = B.length;
   if(AA > BB) return false;
   if(AA < BB) return true;
   // AA = BB, compare indexes from biggest to smallest.
   for(i = AA - 1; i >= 0; i -- )
   {
      if(A[i] < B[i]) return true;
      if(A[i] > B[i]) return false;
   }
   return false;
}

function orderArrayMult(Abase, A, B)
{
   return lessThan(A, B) ? resultmult = naiveMult(Abase, B, A) : resultmult = naiveMult(Abase, A, B);
}

function prepMult(multOne, multTwo)
{
   if(multOne.length > multTwo.length)
   {
      mbigArr = multOne.length;
      msmallArr = multTwo.length
   }
   else
   {
      mbigArr = multTwo.length;
      msmallArr = multOne.length;
   }

}

/* MULTIPLY THE TWO VARIABLES STORED IN MULTONE AND MULTTWO USING THE CHOSEN BASE */

function naiveMult(base, multOne, multTwo)
{

   prepMult(multOne, multTwo);
   var total = [];
   var addResult = [];
   total[0] = 0;
   for (var i = 0; i < msmallArr; i ++ )
   {
      multresult = [];
      remainder = 0;
      tempVal = 0;
      tempDig = 0;
      j = 0;
      if(i > 0)
      {
         for(zero = 0; zero < i; zero ++ ) multresult[zero] = 0;
      }

      while(j < mbigArr)
      {
         intMult ++ ;
         tempVal = (multOne[j] * multTwo[i]) + remainder;
         remainder = 0;
         if (tempVal >= base)
         {
            tempDig = tempVal % base;
            remainder = (tempVal - tempDig) / base;
            multresult[j + i] = tempDig;
         }
         else
         {
            multresult[j + i] = tempVal;
         }
         j ++ ;
      }

      if(remainder != 0)
      {
         // Remainder after last digit multiplication
         multresult[j + i] = remainder;
      }
      smallAddArr = multresult.length;
      bigAddArr = total.length;
      addResult = naiveAdd(base, multresult, total, smallAddArr, bigAddArr);
      total = addResult;
   }

   while (total[total.length - 1] == 0 && total.length - 1 > 0)
   {
      total.splice(total.length - 1, 1)
   }
   document.calc.trash.value += total + " = " + multOne + " * " + multTwo + "\n";
   return total;
}


/* ADD TWO THE TWO VARIABLES STORED IN ADDONE AND ADDTWO USING CHOSEN BASE */

function naiveAdd(base, addOne, addTwo)
{
   prepAdd(addOne, addTwo);
   addResult = [];
   remainder = 0;

   for (i = 0; i < asmallArr; i ++ )
   {
      intAdd ++ ;
      addOne[i] = parseInt(addOne[i]);
      addTwo[i] = parseInt(addTwo[i]);
      if (isNaN(addOne[i])) addOne[i] = 0;
      if (isNaN(addTwo[i])) addTwo[i] = 0;
      addResult[i] = addOne[i] + addTwo[i] + remainder;
      if (addResult[i] >= base)
      {
         addResult[i] = addResult[i] - base;
         remainder = 1;
         intCarry ++ ;
      }
      else
      {
         remainder = 0;
      }
   }
   // Copying values from the shorter string
   while(i < abigArr)
   {
      addOne[i] = parseInt(addOne[i]);
      addResult[i] = addOne[i] + remainder;
      remainder = 0;
      i ++ ;
   }
   // If strings of equal length but there is a remainder;
   if (remainder == 1) addResult[i ++ ] = 1;
   else addResult.splice(i, 1);
   return addResult;
}

function prepAdd(addOne, addTwo)
{
   if(addOne.length > addTwo.length)
   {
      abigArr = addOne.length;
      asmallArr = addTwo.length
   }
   else
   {
      abigArr = addTwo.length;
      asmallArr = addOne.length;
   }
   // Parse with zeros to get same length, and make sure they are integers.
   //   for (i = 0; i < bigArr; i ++ )
   //   {
   // multOne[i] = parseInt(multOne[i]);
   // multTwo[i] = parseInt(multTwo[i]);
   // if (isNaN(multOne[i])) multOne[i] = 0;
   // if (isNaN(multTwo[i])) multTwo[i] = 0;
   //   }
}

/* FIX THIS LATER */

function prepSubt(subOne, subTwo)
{
   if(subOne.length > subTwo.length)
   {
      bigArr = subOne.length;
      smallArr = subTwo.length
   }
   else
   {
      bigArr = subTwo.length;
      smallArr = subOne.length;
   }
   // Parse with zeros to get same length, and make sure they are integers.
   for (i = 0; i < bigArr; i ++ )
   {
      subOne[i] = parseInt(subOne[i]);
      subTwo[i] = parseInt(subTwo[i]);
      if (isNaN(subOne[i])) subOne[i] = 0;
      if (isNaN(subTwo[i])) subTwo[i] = 0;
   }
}

/* SUBTRACT THE TWO VARIABLES STORED IN SUBONE AND SUBTWO USING THE CHOSEN BASE */

function naiveSub(base, subOne, subTwo)
{
   prepSubt(subOne, subTwo);
   result = [];
   for (i = 0; i < smallArr; i ++ )
   {
      j = 0;

      if (subOne[i] < subTwo[i])
      {

         intBorrow ++ ;
         subOne[i] += base;
         j = i;
         while (subOne[j + 1] == 0)
         {
            subOne[j + 1] += base - 1;

            j ++ ;
         }
         subOne[j + 1] += - 1;

      }

      j = 0;
      result[i] = subOne[i] - subTwo[i];
      intSub ++ ;
   }
   while(i < bigArr)
   {
      result[i] = subOne[i];
      i ++ ;
   }

   while (result[result.length - 1] == 0 && result.length - 1 > 0)
   {
      result.splice(result.length - 1, 1)
   }
   return result;
}

/* RESET FORM FIELDS, FETCH BASE AND STRING TO EVALUATE */

function fetchVal()
{
   document.calc.stats.value = "";
   strEval = document.calc.eval.value;
   genArr[0] = strEval;
   base = document.calc.formbase.value;
   base = parseInt(base);
}

/* DO CONVERSION OF OPERANDS TO BASE OF CHOICE */

function baseConversion()
{
   arrOne = genArr[0].split("").reverse();
   arrOne = newbase(arrOne, base);
   arrOne.reverse();
   if (base < 11)
   {
      bout = arrOne.join("");
   }
   else
   {
      bout = arrOne
   }
   for(j = 0; j < arrOne.length; j ++ )
   {
      intRev = arrOne[j].toString();
      arrOne[j] = intRev.split("").reverse().join("");
   }
   document.calc.stats.value += "Converted base digits = " + bout.length + "\n";
   document.calc.stats.value += "Converted arrOne " + bout + "\n";
}



function orderArraySubt(Abase, A, B)
{
   return lessThan(A, B) ? resultmult = naiveSub(Abase, B, A) : resultmult = naiveSub(Abase, A, B);
}


/* GLOBAL VARIABLES AND ARRAY FORMAT */
/* THE NOTATION OF NUMERALS USE BASE TEN, SO FOR INDEX VALUES IN ARRAY IF BASE 2000, DIGITVALUE IN INDEX RANGE = (0 - 1999) */
/* VARIABLES ARE STORED REVERSED IN ARRAY */
/* WITH A SINGLE "DIGITPLACE/VALUE" OF THE CHOSEN BASE, HOLD AT EACH INDEX */

function MAIN()
{

   /* INIT GLOBAL VARIABLES START */
   genArr = [];
   baseArr = [];
   resultmult = [];
   plusOne = [];
   plusOne[0] = 1;
   arrOne = [];
   arrTwo = [];
   tempA = [];
   tempB = [];
   // Counters, adds, subtraction, multiplications
   intMult = 0;
   intAdd = 0;
   intSub = 0;
   intBorrow = 0;
   intCarry = 0;
   // Length of the operands
   bigArr = 0;
   smallArr = 0;
   addBigLength = 0;
   addSmallLength = 0;
   baseStr = "";
   // Reset variables from form
   found = false;
   base = 0;
   strEval = "";
   document.calc.stats.value = "";
   document.calc.trash.value = "";
   document.calc.trash.value += "Array VALUES printed out are reversed\n";
   fetchVal();
   // Get stringsvalues from form

   /* INIT END */
   /* MAIN FUNCTION */
   document.calc.stats.value += "Operand A decimal digits = " + strEval.length + "\n";
   // Do base conversion into the base fetched from form
   baseConversion();
}
</script>

<meta charset="utf-8"></head>
<body onload="MAIN()" bgcolor="gold">
<h3>BIG NUMBERS BASE CONVERTER (anybase) version 0.0001 ;)</h3><p>
</p><form name="calc" onsubmit="MAIN(); return false;"><b>
<input name="calc" value="Calc" type="submit"> *use radiX* <input name="formbase" value="1137911379" size="10" type="text"><br><br>
Trash print<br>
<textarea name="trash" rows="20" cols="120"></textarea><br>
Base 10 value to convert<br>
<textarea name="eval" rows="2" cols="120">14345784357437584375439075437543754375437054375437504354385743507434554354543543543543543</textarea><br>
New base out<br>
<textarea name="stats" rows="40" cols="120"></textarea>
</form>
</body>
</html>

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


#28220

From"Evertjan." <exxjxw.hannivoort@inter.nl.net>
Date2015-06-29 16:32 +0200
Message-ID<XnsA4C8A845C12EDeejj99@194.109.6.166>
In reply to#28207
jonas.thornvall@gmail.com wrote on 29 Jun 2015 in comp.lang.javascript:

> Could there be limitation upon how a tree structure allowed to look?

It looks silly for starters!
Who do you think will allow you how code has to look? 
Only yourself!

But silly looking code will make it far more difficult
for you to understand what goes on.


>  while(olddigits >= 0) {

This is the only line that makes some sense

>       while (looptwo == true)

while (looptwo)

>       {
>   
>          for(y = 0; y < tOne.length; y ++ )
>          {
>          }

This loop does not do a thing!!!!!!!!!

>              if (looptwo==true){

if (looptwo) {

    
>          if(mycomp==true){break; }

if(mycomp)break;

>          }
>        
>          if(found == true)
>          {
>                 break;
>          }

if(found) break;

>          else
>          {

not neccesary, as the "break;" leaves no choice 

     
>             if(looptwo == true && mymax != mymin + 1)
>             {
>           
>             }
>             else

empty true clause is nonsense, try:

if(!looptwo || mymax-mymin==1)

>             {
>                if (mymin + 1 == mymax)

if (mymax-mymin==1) // why two versions of the same formula?

>                {
>               
>                }
>                else
>                {
>             
>               }
>             }
>          }
> 
>       }

well, it seems you are not showing us the real code.


-- 
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)

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


#28221

From"Christoph M. Becker" <cmbecker69@arcor.de>
Date2015-06-29 16:49 +0200
Message-ID<mmrluh$skj$1@solani.org>
In reply to#28220
Evertjan. wrote:

> jonas.thornvall@gmail.com wrote on 29 Jun 2015 in comp.lang.javascript:
> 
>>          for(y = 0; y < tOne.length; y ++ )
>>          {
>>          }
> 
> This loop does not do a thing!!!!!!!!!

Well, it does change the value of y, what might be an important
side-effect for Jonas' code.

-- 
Christoph M. Becker

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


#28223

From"Evertjan." <exxjxw.hannivoort@inter.nl.net>
Date2015-06-29 17:06 +0200
Message-ID<XnsA4C8ADFF96647eejj99@194.109.6.166>
In reply to#28221
"Christoph M. Becker" <cmbecker69@arcor.de> wrote on 29 Jun 2015 in 
comp.lang.javascript:

> Evertjan. wrote:
> 
>> jonas.thornvall@gmail.com wrote on 29 Jun 2015 in comp.lang.javascript:
>> 
>>>          for(y = 0; y < tOne.length; y ++ )
>>>          {
>>>          }
>> 
>> This loop does not do a thing!!!!!!!!!
> 
> Well, it does change the value of y, what might be an important
> side-effect for Jonas' code.

"y"? you mean "why"?

Indeed this is the perfect way to say:

y = tOne.length;

-- 
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)

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


Page 3 of 5 — ← Prev page 1 2 [3] 4 5  Next page →

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


csiph-web