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


Groups > comp.lang.javascript > #27602

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

Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!1.eu.feeder.erje.net!eternal-september.org!feeder.eternal-september.org!mx02.eternal-september.org!.POSTED!not-for-mail
From Ben Bacarisse <ben.usenet@bsb.me.uk>
Newsgroups comp.lang.javascript
Subject Re: Calculate/Interpolate size of y in x^y = z when you do know "number of digits z" and base x?
Date Mon, 11 May 2015 21:49:48 +0100
Organization A noiseless patient Spider
Lines 21
Message-ID <87d22696vn.fsf@bsb.me.uk> (permalink)
References <a82630ee-3383-4c55-8da3-4cb092bcc1ae@googlegroups.com> <f7e8df7f-843c-43e8-8c00-66a30ac810dc@googlegroups.com> <dd8b527d-a2f8-428d-9419-2b5d2017baab@googlegroups.com> <87oalr8e8a.fsf@bsb.me.uk> <1bf84118-cdf4-40de-8913-bc86abe4db65@googlegroups.com>
Mime-Version 1.0
Content-Type text/plain
Injection-Info mx02.eternal-september.org; posting-host="017616aa25f81ec581c44d76d61ba2f3"; logging-data="6876"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+f/k9i4qolpDLp1un+dzhp0r9rRlNV6Lg="
Cancel-Lock sha1:bv6wnKIUuvmLG6kMoYOaEy5vyM0= sha1:ztGazPb1PkKKDxMvQ6BpVgAYBXY=
X-BSB-Auth 1.005df525cc9263c14209.20150511214948BST.87d22696vn.fsf@bsb.me.uk
Xref csiph.com comp.lang.javascript:27602

Show key headers only | View raw


jonas.thornvall@gmail.com writes:
<snip>
> An example using a small integer we search 2188 and base is 3. 
>
> So 2188=3^y   
> y is an integer.

I don't think that was obvious, but I suspect you don't need to know
this number.  You posted some code the uses this number but it was more
complicated than it needed to be.

> 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?

If you use the number of digits, you *are* using logarithms.  That's
what a logarithm is.

<snip>
-- 
Ben.

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


Thread

Calculate/Interpolate size of y in  x^y = z  when you do know "number of  digits z" and  base  x? jonas.thornvall@gmail.com - 2015-05-11 04:22 -0700
  Re: Calculate/Interpolate size of y in  x^y = z  when you do know "number of  digits z" and  base  x? jonas.thornvall@gmail.com - 2015-05-11 04:28 -0700
    Re: Calculate/Interpolate size of y in  x^y = z  when you do know "number of  digits z" and  base  x? jonas.thornvall@gmail.com - 2015-05-11 05:47 -0700
      Re: Calculate/Interpolate size of y in  x^y = z  when you do know "number of  digits z" and  base  x? Ben Bacarisse <ben.usenet@bsb.me.uk> - 2015-05-11 13:56 +0100
        Re: Calculate/Interpolate size of y in  x^y = z  when you do know "number of  digits z" and  base  x? jonas.thornvall@gmail.com - 2015-05-11 06:12 -0700
          Re: Calculate/Interpolate size of y in  x^y = z  when you do know "number of  digits z" and  base  x? jonas.thornvall@gmail.com - 2015-05-11 06:19 -0700
          Re: Calculate/Interpolate size of y in  x^y = z  when you do know "number of  digits z" and  base  x? Ben Bacarisse <ben.usenet@bsb.me.uk> - 2015-05-11 21:49 +0100
  Re: Calculate/Interpolate size of y in  x^y = z  when you do know "number of  digits z" and  base  x? "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2015-05-11 15:19 +0200
    Re: Calculate/Interpolate size of y in  x^y = z  when you do know "number of  digits z" and  base  x? jonas.thornvall@gmail.com - 2015-05-11 06:25 -0700
    Re: Calculate/Interpolate size of y in  x^y = z  when you do know "number of  digits z" and  base  x? jonas.thornvall@gmail.com - 2015-05-11 06:30 -0700
      Re: Calculate/Interpolate size of y in  x^y = z  when you do know "number of  digits z" and  base  x? "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2015-05-11 18:18 +0200
        Re: Calculate/Interpolate size of y in  x^y = z  when you do know "number of  digits z" and  base  x? jonas.thornvall@gmail.com - 2015-05-11 09:32 -0700
          Re: Calculate/Interpolate size of y in  x^y = z  when you do know "number of  digits z" and  base  x? "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2015-05-11 19:45 +0200
            Re: Calculate/Interpolate size of y in  x^y = z  when you do know "number of  digits z" and  base  x? "Christoph M. Becker" <cmbecker69@arcor.de> - 2015-05-11 22:58 +0200
              Re: Calculate/Interpolate size of y in  x^y = z  when you do know "number of  digits z" and  base  x? "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2015-05-11 23:13 +0200

csiph-web