Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.javascript > #27216 > unrolled thread
| Started by | jonas.thornvall@gmail.com |
|---|---|
| First post | 2015-04-07 02:43 -0700 |
| Last post | 2015-04-07 14:33 +0100 |
| Articles | 5 on this page of 45 — 6 participants |
Back to article view | Back to comp.lang.javascript
Best search algorithm to find a condition within a range. jonas.thornvall@gmail.com - 2015-04-07 02:43 -0700
Re: Best search algorithm to find a condition within a range. "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2015-04-07 13:07 +0200
Re: Best search algorithm to find a condition within a range. jonas.thornvall@gmail.com - 2015-04-07 04:38 -0700
Re: Best search algorithm to find a condition within a range. jonas.thornvall@gmail.com - 2015-04-07 04:48 -0700
Re: Best search algorithm to find a condition within a range. "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2015-04-07 14:49 +0200
Re: Best search algorithm to find a condition within a range. Ben Bacarisse <ben.usenet@bsb.me.uk> - 2015-04-07 13:27 +0100
Re: Best search algorithm to find a condition within a range. jonas.thornvall@gmail.com - 2015-04-07 06:04 -0700
Re: Best search algorithm to find a condition within a range. Ben Bacarisse <ben.usenet@bsb.me.uk> - 2015-04-07 14:23 +0100
Re: Best search algorithm to find a condition within a range. jonas.thornvall@gmail.com - 2015-04-07 06:54 -0700
Re: Best search algorithm to find a condition within a range. Ben Bacarisse <ben.usenet@bsb.me.uk> - 2015-04-07 16:31 +0100
Re: Best search algorithm to find a condition within a range. jonas.thornvall@gmail.com - 2015-04-07 08:59 -0700
Re: Best search algorithm to find a condition within a range. Ben Bacarisse <ben.usenet@bsb.me.uk> - 2015-04-07 19:58 +0100
Re: Best search algorithm to find a condition within a range. Dr J R Stockton <reply1500@merlyn.demon.co.uk.invalid> - 2015-04-09 23:08 +0100
Re: Best search algorithm to find a condition within a range. Ben Bacarisse <ben.usenet@bsb.me.uk> - 2015-04-10 00:02 +0100
Re: Best search algorithm to find a condition within a range. Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2015-04-07 18:37 +0200
Re: Best search algorithm to find a condition within a range. jonas.thornvall@gmail.com - 2015-04-07 09:55 -0700
Re: Best search algorithm to find a condition within a range. "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2015-04-07 20:30 +0200
Re: Best search algorithm to find a condition within a range. Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2015-04-07 20:58 +0200
Re: Best search algorithm to find a condition within a range. "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2015-04-07 22:19 +0200
Re: Best search algorithm to find a condition within a range. jonas.thornvall@gmail.com - 2015-04-08 00:14 -0700
Re: Best search algorithm to find a condition within a range. "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2015-04-08 10:55 +0200
Re: Best search algorithm to find a condition within a range. Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2015-04-09 13:03 +0200
Re: Best search algorithm to find a condition within a range. "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2015-04-09 14:11 +0200
Re: Best search algorithm to find a condition within a range. "Christoph M. Becker" <cmbecker69@arcor.de> - 2015-04-09 14:55 +0200
Re: Best search algorithm to find a condition within a range. "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2015-04-09 15:20 +0200
Re: Best search algorithm to find a condition within a range. Ben Bacarisse <ben.usenet@bsb.me.uk> - 2015-04-09 14:49 +0100
Re: Best search algorithm to find a condition within a range. Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2015-04-09 16:10 +0200
Re: Best search algorithm to find a condition within a range. "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2015-04-09 16:17 +0200
Re: Best search algorithm to find a condition within a range. jonas.thornvall@gmail.com - 2015-04-09 07:22 -0700
Re: Best search algorithm to find a condition within a range. "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2015-04-09 16:44 +0200
Re: Best search algorithm to find a condition within a range. jonas.thornvall@gmail.com - 2015-04-09 07:57 -0700
Re: Best search algorithm to find a condition within a range. jonas.thornvall@gmail.com - 2015-04-09 08:05 -0700
Re: Best search algorithm to find a condition within a range. Ben Bacarisse <ben.usenet@bsb.me.uk> - 2015-04-09 17:04 +0100
Re: Best search algorithm to find a condition within a range. Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2015-04-09 16:14 +0200
Re: Best search algorithm to find a condition within a range. "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2015-04-09 16:34 +0200
Re: Best search algorithm to find a condition within a range. Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2015-04-09 17:39 +0200
Re: Best search algorithm to find a condition within a range. "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2015-04-09 18:04 +0200
Re: Best search algorithm to find a condition within a range. Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2015-04-09 18:26 +0200
Re: Best search algorithm to find a condition within a range. "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2015-04-09 22:13 +0200
Re: Best search algorithm to find a condition within a range. jonas.thornvall@gmail.com - 2015-04-07 10:00 -0700
Re: Best search algorithm to find a condition within a range. jonas.thornvall@gmail.com - 2015-04-07 06:16 -0700
Re: Best search algorithm to find a condition within a range. "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2015-04-07 15:28 +0200
Re: Best search algorithm to find a condition within a range. jonas.thornvall@gmail.com - 2015-04-07 06:58 -0700
Re: Best search algorithm to find a condition within a range. "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2015-04-07 20:25 +0200
Re: Best search algorithm to find a condition within a range. Ben Bacarisse <ben.usenet@bsb.me.uk> - 2015-04-07 14:33 +0100
Page 3 of 3 — ← Prev page 1 2 [3]
| From | jonas.thornvall@gmail.com |
|---|---|
| Date | 2015-04-07 06:16 -0700 |
| Message-ID | <874ae3ae-e2a5-4d00-a7dc-e0b25368d758@googlegroups.com> |
| In reply to | #27221 |
Den tisdag 7 april 2015 kl. 14:27:36 UTC+2 skrev Ben Bacarisse:
> jonas.thornvall@gmail.com writes:
>
> > I want todo faster baseconversion for very big bases like base 1 000
> > 000, so instead of adding up digits i search it.
>
> The size of the base is immaterial, provided that it is in the range for
> which arithmetic operations are exact. 1,000,000 is well within that
> range.
>
> <snip>
> > <SCRIPT LANGUAGE="Javascript">
> > //CONVERT A DECIMAL NUMBER INTO ANYBASE
> > function newbase(decNumber,base){
>
> Your terms are wrong, and I don't think this is just a trivial detail --
> I think maybe it points to something you've misunderstood. The value in
> "decNumber" is not decimal -- it's just a number. Internally it is
> represented in a very well-defined format that uses binary for both a
> fraction and an exponent, but you don't need to care about that. You
> just want to do arithmetic on it. (Maybe one day you will write a
> routine like this that takes a bignum in base X and converts it to
> bignum in base Y, but for the moment, you don't seem to be doing that at
> all.)
>
> Anyway, the algorithm for representing a number in base B is the same
> whatever the base is: the least significant digit is obtained by using
> the remainder operation (%) and you can move on to the next one by
> dividing the number by the base. I think you know this already.
>
> <snip>
> --
> Ben.
Regarding the terms what terms is wrong?
There ain't no other name for decimal number then a decimal encoded number. Integers are just decimal encoded numbers. If you work in base 8 they are not integers. They are integers because they use 10 unique digits.
And a digit is just one of those unique digit 0-9.
I probably should named digits to digitplace but it was to long.
Digmult is a multiple of the exponent using a specific base at a specific digiplace, so i can hardly name it exponent.
I think i named my variable straightforward.
[toc] | [prev] | [next] | [standalone]
| From | "Evertjan." <exxjxw.hannivoort@inter.nl.net> |
|---|---|
| Date | 2015-04-07 15:28 +0200 |
| Message-ID | <XnsA4759D6B449ECeejj99@194.109.133.246> |
| In reply to | #27225 |
jonas.thornvall@gmail.com wrote on 07 apr 2015 in comp.lang.javascript: > Integers are just decimal encoded numbers. If you work in base 8 they > are not integers. Wrong. An integer is a number without a fraction. An integer can be written in any number base, not just in base 10, but also in base 2 and base 36, and when the numeric value is the same, the integers are the same, independent of what base notation is used. -- Evertjan. The Netherlands. (Please change the x'es to dots in my emailaddress)
[toc] | [prev] | [next] | [standalone]
| From | jonas.thornvall@gmail.com |
|---|---|
| Date | 2015-04-07 06:58 -0700 |
| Message-ID | <1fdc08c8-5d56-4fed-aaf7-b4004eeb7ea1@googlegroups.com> |
| In reply to | #27228 |
Den tisdag 7 april 2015 kl. 15:28:34 UTC+2 skrev Evertjan.: > jonas.thornvall@gmail.com wrote on 07 apr 2015 in comp.lang.javascript: > > > Integers are just decimal encoded numbers. If you work in base 8 they > > are not integers. > > Wrong. > > An integer is a number without a fraction. > > An integer can be written in any number base, > not just in base 10, > but also in base 2 and base 36, > and when the numeric value is the same, > the integers are the same, > independent of what base notation is used. > > -- > Evertjan. > The Netherlands. > (Please change the x'es to dots in my emailaddress) But javascript will interpretate the number you put in as a decimal encoded number. Otherwise the answer to x=21+21 would be unknown and not x=42.
[toc] | [prev] | [next] | [standalone]
| From | "Evertjan." <exxjxw.hannivoort@inter.nl.net> |
|---|---|
| Date | 2015-04-07 20:25 +0200 |
| Message-ID | <XnsA475CFC9E3066eejj99@194.109.133.246> |
| In reply to | #27232 |
jonas.thornvall@gmail.com wrote on 07 apr 2015 in comp.lang.javascript:
> Den tisdag 7 april 2015 kl. 15:28:34 UTC+2 skrev Evertjan.:
>> jonas.thornvall@gmail.com wrote on 07 apr 2015 in comp.lang.javascript:
>>
>> > Integers are just decimal encoded numbers. If you work in base 8 they
>> > are not integers.
>>
>> Wrong.
>>
>> An integer is a number without a fraction.
>>
>> An integer can be written in any number base,
>> not just in base 10,
>> but also in base 2 and base 36,
>> and when the numeric value is the same,
>> the integers are the same,
>> independent of what base notation is used.
>
> But javascript will interpretate the number you put in as a decimal
> encoded number.
Not "interpretation",
but "parsing" of string notation ment to be a number,
but that has nothing to do with what an integer is.
An integer is not defined by the basenumber of the stringy notation.
An integer is a special kind of numeric value,
totally independent of the notation.
> Otherwise the answer to x=21+21 would be unknown and not x=42.
Nonsense, not "otherwise".
Whay you see is just the parsing of a string,
not the value of an integer.
This returns an integer too,
but much larger than 84:
x = ('' + 21 + 21) * 2;
--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
[toc] | [prev] | [next] | [standalone]
| From | Ben Bacarisse <ben.usenet@bsb.me.uk> |
|---|---|
| Date | 2015-04-07 14:33 +0100 |
| Message-ID | <87k2xoysem.fsf@bsb.me.uk> |
| In reply to | #27225 |
jonas.thornvall@gmail.com writes:
> Den tisdag 7 april 2015 kl. 14:27:36 UTC+2 skrev Ben Bacarisse:
>> jonas.thornvall@gmail.com writes:
<snip>
>> > <SCRIPT LANGUAGE="Javascript">
>> > //CONVERT A DECIMAL NUMBER INTO ANYBASE
>> > function newbase(decNumber,base){
>>
>> Your terms are wrong, and I don't think this is just a trivial detail --
>> I think maybe it points to something you've misunderstood. The value in
>> "decNumber" is not decimal -- it's just a number. Internally it is
>> represented in a very well-defined format that uses binary for both a
>> fraction and an exponent, but you don't need to care about that. You
>> just want to do arithmetic on it.
<snip>
> Regarding the terms what terms is wrong?
> There ain't no other name for decimal number then a decimal encoded
> number.
There was no hint in the code that the variable named decNumber held
anything other than an ECMAScript value of type Number. The code did
arithmetic on it using ECMAScript's built in operators that work on
Number values. In what sense do you think (or, more to the point, care)
that it is "decimal"?
<snip>
--
Ben.
[toc] | [prev] | [standalone]
Page 3 of 3 — ← Prev page 1 2 [3]
Back to top | Article view | comp.lang.javascript
csiph-web