[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.javascript

Calculate/Interpolate size of y in x^y = z when you do know "number of digits z" and base x?

JT

5/11/2015 11:22:00 AM

If i have a very bignumber z in decimal, i know the number of digits let us say 100 digits and base is x=64.

How can i interpolate, find a closeby y (where base is x).
I do understand that i can add 1 to y until i reach the neighbourhood.

But is there any general rule to use to close in faster when you do know x and the number of digits in z?

14 Answers

JT

5/11/2015 11:28:00 AM

0

Den måndag 11 maj 2015 kl. 13:22:30 UTC+2 skrev jonas.t...@gmail.com:
> If i have a very bignumber z in decimal, i know the number of digits let us say 100 digits and base is x=64.
>
> How can i interpolate, find a closeby y (where base is x).
> I do understand that i can add 1 to y until i reach the neighbourhood.
>
> But is there any general rule to use to close in faster when you do know x and the number of digits in z?

Sorry i was not clear i look for the closest integer of y bigger or smaller.

JT

5/11/2015 12:48:00 PM

0

Den måndag 11 maj 2015 kl. 13:28:06 UTC+2 skrev jonas.t...@gmail.com:
> Den måndag 11 maj 2015 kl. 13:22:30 UTC+2 skrev jonas.t...@gmail.com:
> > If i have a very bignumber z in decimal, i know the number of digits let us say 100 digits and base is x=64.
> >
> > How can i interpolate, find a closeby y (where base is x).
> > I do understand that i can add 1 to y until i reach the neighbourhood.
> >
> > But is there any general rule to use to close in faster when you do know x and the number of digits in z?
>
> Sorry i was not clear i look for the closest integer of y bigger or smaller.

But maybe assuming y is large like 1000 doing a search closing in by setting min and max is faster, than doing the calculation using logaritms?

Ben Bacarisse

5/11/2015 12:56:00 PM

0

jonas.thornvall@gmail.com writes:

> Den måndag 11 maj 2015 kl. 13:28:06 UTC+2 skrev jonas.t...@gmail.com:
>> Den måndag 11 maj 2015 kl. 13:22:30 UTC+2 skrev jonas.t...@gmail.com:
>> > If i have a very bignumber z in decimal, i know the number of
>> > digits let us say 100 digits and base is x=64.
>> >
>> > How can i interpolate, find a closeby y (where base is x).
>> > I do understand that i can add 1 to y until i reach the neighbourhood.
>> >
>> > But is there any general rule to use to close in faster when you
>> > do know x and the number of digits in z?
>>
>> Sorry i was not clear i look for the closest integer of y bigger or smaller.
>
> But maybe assuming y is large like 1000 doing a search closing in by
> setting min and max is faster, than doing the calculation using
> logaritms?

It depends on how y is represented. You say it is "in decimal". If
that means it's a string then you just find the . and remove any
trailing digits. This is so obvious that it can't be whay you mean.
How is z stored in the program?

--
Ben.

JT

5/11/2015 1:13:00 PM

0

Den måndag 11 maj 2015 kl. 14:56:28 UTC+2 skrev Ben Bacarisse:
> jonas.thornvall@gmail.com writes:
>
> > Den måndag 11 maj 2015 kl. 13:28:06 UTC+2 skrev jonas.t...@gmail.com:
> >> Den måndag 11 maj 2015 kl. 13:22:30 UTC+2 skrev jonas.t...@gmail.com:
> >> > If i have a very bignumber z in decimal, i know the number of
> >> > digits let us say 100 digits and base is x=64.
> >> >
> >> > How can i interpolate, find a closeby y (where base is x).
> >> > I do understand that i can add 1 to y until i reach the neighbourhood.
> >> >
> >> > But is there any general rule to use to close in faster when you
> >> > do know x and the number of digits in z?
> >>
> >> Sorry i was not clear i look for the closest integer of y bigger or smaller.
> >
> > But maybe assuming y is large like 1000 doing a search closing in by
> > setting min and max is faster, than doing the calculation using
> > logaritms?
>
> It depends on how y is represented. You say it is "in decimal". If
> that means it's a string then you just find the . and remove any
> trailing digits. This is so obvious that it can't be whay you mean.
> How is z stored in the program?
>
> --
> Ben.

An example using a small integer we search 2188 and base is 3.

So 2188=3^y
y is an integer.

I think mathetmaticians use logarithms for this kind of problem, but i am not sure that is fastest approach. Maybe a search algorithm, or other approaches are faster when one know the number of digits?

In this case the seareched number would be y=7 since i search (min?) the smaller value, not y=8 (max?) the bigger value.

JT

5/11/2015 1:19:00 PM

0

Den måndag 11 maj 2015 kl. 15:12:38 UTC+2 skrev jonas.t...@gmail.com:
> Den måndag 11 maj 2015 kl. 14:56:28 UTC+2 skrev Ben Bacarisse:
> > jonas.thornvall@gmail.com writes:
> >
> > > Den måndag 11 maj 2015 kl. 13:28:06 UTC+2 skrev jonas.t...@gmail.com:
> > >> Den måndag 11 maj 2015 kl. 13:22:30 UTC+2 skrev jonas.t...@gmail.com:
> > >> > If i have a very bignumber z in decimal, i know the number of
> > >> > digits let us say 100 digits and base is x=64.
> > >> >
> > >> > How can i interpolate, find a closeby y (where base is x).
> > >> > I do understand that i can add 1 to y until i reach the neighbourhood.
> > >> >
> > >> > But is there any general rule to use to close in faster when you
> > >> > do know x and the number of digits in z?
> > >>
> > >> Sorry i was not clear i look for the closest integer of y bigger or smaller.
> > >
> > > But maybe assuming y is large like 1000 doing a search closing in by
> > > setting min and max is faster, than doing the calculation using
> > > logaritms?
> >
> > It depends on how y is represented. You say it is "in decimal". If
> > that means it's a string then you just find the . and remove any
> > trailing digits. This is so obvious that it can't be whay you mean.
> > How is z stored in the program?
> >
> > --
> > Ben.
>
> An example using a small integer we search 2188 and base is 3.
>
> So 2188=3^y
> y is an integer.
>
> I think mathetmaticians use logarithms for this kind of problem, but i am not sure that is fastest approach. Maybe a search algorithm, or other approaches are faster when one know the number of digits?
>
> In this case the seareched number would be y=7 since i search (min?) the smaller value, not y=8 (max?) the bigger value.

I think i had some formula selfinvented when i did this years ago, setting the startvalue for search dependent upon the digits of number and the base.

Is there away approximate y closely when you know the base=x and the number of digits in z?
Really don't remember.

Evertjan.

5/11/2015 1:20:00 PM

0

jonas.thornvall@gmail.com wrote on 11 mei 2015 in comp.lang.javascript:

> Subject: Calculate/Interpolate size of y in x^y = z when you do know
"number of digits z" and base x?

Please do not use the subject line for your Q,
or at least repeat it in the text.

Is "size of y" not the same as "value of y",
and if not, why not?

> If i have a very bignumber z in decimal, i know the number of digits let
> us say 100 digits and base is x=64.

"Very big number", bignumbers [as all substantives] cannot be "very".

What do you mean by "decimal" if the base is 64?

Doesn't "decimal" mean base=10?

> How can i interpolate, find a closeby y (where base is x).

You are asking for a value, values have no base.

> I do understand that i can add 1 to y until i reach the neighbourhood.

Welcome to the neighborhood.

The neighborhood of what?

> But is there any general rule to use to close in faster when you do know x
> and the number of digits in z?

Sorry?

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

JT

5/11/2015 1:25:00 PM

0

Den måndag 11 maj 2015 kl. 15:19:51 UTC+2 skrev Evertjan.:
> jonas.thornvall@gmail.com wrote on 11 mei 2015 in comp.lang.javascript:
>
> > Subject: Calculate/Interpolate size of y in x^y = z when you do know
> "number of digits z" and base x?
>
> Please do not use the subject line for your Q,
> or at least repeat it in the text.
>
> Is "size of y" not the same as "value of y",
> and if not, why not?
>
> > If i have a very bignumber z in decimal, i know the number of digits let
> > us say 100 digits and base is x=64.
>
> "Very big number", bignumbers [as all substantives] cannot be "very".
>
> What do you mean by "decimal" if the base is 64?
>
> Doesn't "decimal" mean base=10?
>
> > How can i interpolate, find a closeby y (where base is x).
>
> You are asking for a value, values have no base.
>
> > I do understand that i can add 1 to y until i reach the neighbourhood.
>
> Welcome to the neighborhood.
>
> The neighborhood of what?
>
> > But is there any general rule to use to close in faster when you do know x
> > and the number of digits in z?
>
> Sorry?
>
> --
> Evertjan.
> The Netherlands.
> (Please change the x'es to dots in my emailaddress)

An example using a small integer we search 2188 and base is 3.

So 2188=3^y
y is an integer.

In this case the seareched *integer* would be y=7 since i search (min?) the smaller value, not y=8 (max?) the bigger value.

JT

5/11/2015 1:30:00 PM

0

Den måndag 11 maj 2015 kl. 15:19:51 UTC+2 skrev Evertjan.:
> jonas.thornvall@gmail.com wrote on 11 mei 2015 in comp.lang.javascript:
>
> > Subject: Calculate/Interpolate size of y in x^y = z when you do know
> "number of digits z" and base x?
>
> Please do not use the subject line for your Q,
> or at least repeat it in the text.
>
> Is "size of y" not the same as "value of y",
> and if not, why not?
>
> > If i have a very bignumber z in decimal, i know the number of digits let
> > us say 100 digits and base is x=64.
>
> "Very big number", bignumbers [as all substantives] cannot be "very".
>
> What do you mean by "decimal" if the base is 64?
>
> Doesn't "decimal" mean base=10?
>
> > How can i interpolate, find a closeby y (where base is x).
>
> You are asking for a value, values have no base.
>
> > I do understand that i can add 1 to y until i reach the neighbourhood.
>
> Welcome to the neighborhood.
>
> The neighborhood of what?
>
> > But is there any general rule to use to close in faster when you do know x
> > and the number of digits in z?
>
> Sorry?
>
> --
> Evertjan.
> The Netherlands.
> (Please change the x'es to dots in my emailaddress)

By the way the baseconverter do support bignumbers now anybase anysize of number.

Now it would be nice with some speed, doing it the fastest way searching the correct digitplace. I think that will be faster than calculate using logarithms.

Evertjan.

5/11/2015 4:18:00 PM

0

jonas.thornvall@gmail.com wrote on 11 mei 2015 in comp.lang.javascript:

> Den måndag 11 maj 2015 kl. 15:19:51 UTC+2 skrev Evertjan.:
>> jonas.thornvall@gmail.com wrote on 11 mei 2015 in comp.lang.javascript:
>>
>> > Subject: Calculate/Interpolate size of y in x^y = z when you do kno
> w
>> "number of digits z" and base x?
>>
>> Please do not use the subject line for your Q,
>> or at least repeat it in the text.
>>
>> Is "size of y" not the same as "value of y",
>> and if not, why not?
>>
>> > If i have a very bignumber z in decimal, i know the number of digits
>> > le
> t
>> > us say 100 digits and base is x=64.
>>
>> "Very big number", bignumbers [as all substantives] cannot be "very".
>>
>> What do you mean by "decimal" if the base is 64?
>>
>> Doesn't "decimal" mean base=10?
>>
>> > How can i interpolate, find a closeby y (where base is x).
>>
>> You are asking for a value, values have no base.
>>
>> > I do understand that i can add 1 to y until i reach the
>> > neighbourhood.
>>
>> Welcome to the neighborhood.
>>
>> The neighborhood of what?
>>
>> > But is there any general rule to use to close in faster when you do
>> > kno
> w x
>> > and the number of digits in z?
>>
>> Sorry?

[Signature removed, as I asked you to do several times]

> By the way the baseconverter do support bignumbers now anybase anysize
> of number.
>
> Now it would be nice with some speed, doing it the fastest way searching
> the correct digitplace. I think that will be faster than calculate using
> logarithms.

Do you never interact with people?

You are not answering my questions about the request YOU made.

It seems you are not interested in communicating with us,
because if you responde, you possibly did not even read the posting you are
responding on.

And in most cases you are just responding to your own postings.

What is the matter with you?

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

JT

5/11/2015 4:33:00 PM

0

Den måndag 11 maj 2015 kl. 18:19:00 UTC+2 skrev Evertjan.:
> jonas.thornvall@gmail.com wrote on 11 mei 2015 in comp.lang.javascript:
>
> > Den måndag 11 maj 2015 kl. 15:19:51 UTC+2 skrev Evertjan.:
> >> jonas.thornvall@gmail.com wrote on 11 mei 2015 in comp.lang.javascript:
> >>
> >> > Subject: Calculate/Interpolate size of y in x^y = z when you do kno
> > w
> >> "number of digits z" and base x?
> >>
> >> Please do not use the subject line for your Q,
> >> or at least repeat it in the text.
> >>
> >> Is "size of y" not the same as "value of y",
> >> and if not, why not?
> >>
> >> > If i have a very bignumber z in decimal, i know the number of digits
> >> > le
> > t
> >> > us say 100 digits and base is x=64.
> >>
> >> "Very big number", bignumbers [as all substantives] cannot be "very".
> >>
> >> What do you mean by "decimal" if the base is 64?
> >>
> >> Doesn't "decimal" mean base=10?
> >>
> >> > How can i interpolate, find a closeby y (where base is x).
> >>
> >> You are asking for a value, values have no base.
> >>
> >> > I do understand that i can add 1 to y until i reach the
> >> > neighbourhood.
> >>
> >> Welcome to the neighborhood.
> >>
> >> The neighborhood of what?
> >>
> >> > But is there any general rule to use to close in faster when you do
> >> > kno
> > w x
> >> > and the number of digits in z?
> >>
> >> Sorry?
>
> [Signature removed, as I asked you to do several times]
>
> > By the way the baseconverter do support bignumbers now anybase anysize
> > of number.
> >
> > Now it would be nice with some speed, doing it the fastest way searching
> > the correct digitplace. I think that will be faster than calculate using
> > logarithms.
>
> Do you never interact with people?
>
> You are not answering my questions about the request YOU made.
>
> It seems you are not interested in communicating with us,
> because if you responde, you possibly did not even read the posting you are
> responding on.
>
> And in most cases you are just responding to your own postings.
>
> What is the matter with you?
>
> --
> Evertjan.
> The Netherlands.
> (Please change the x'es to dots in my emailaddress)

Oh i did but you are not really interested.
One more time for Evertjan
An example using a small integer we search 2188 and base is 3.

So 2188=3^y
y is an integer.

In this case the seareched *integer* would be y=7 since i search (min?) the smaller value, not y=8 (max?) the bigger value.