Author Topic: Anyone got an nth root algorithm?  (Read 3756 times)

0 Members and 1 Guest are viewing this topic.

Offline MWheatley

  • Newbie
  • Posts: 64
    • View Profile
Anyone got an nth root algorithm?
« on: November 01, 2019, 02:15:07 pm »
I'd rather not reinvent the wheel, so if anyone cares to share one, I'd be grateful.

Malcolm

Offline bplus

  • Global Moderator
  • Forum Resident
  • Posts: 8053
  • b = b + ...
    • View Profile
Re: Anyone got an nth root algorithm?
« Reply #1 on: November 01, 2019, 02:24:45 pm »
I'd rather not reinvent the wheel, so if anyone cares to share one, I'd be grateful.

Malcolm

r th root of n = n^(1/r) eg square root of 2 = 2 ^ (1/2) or 2 ^ .5

Offline Qwerkey

  • Forum Resident
  • Posts: 755
    • View Profile
Re: Anyone got an nth root algorithm?
« Reply #2 on: November 02, 2019, 05:18:52 am »
Er, yes: somewhat obvious.  So were you actually asking for something else, Malcolm?  An algorithm sounds rather grand.

Offline MWheatley

  • Newbie
  • Posts: 64
    • View Profile
Re: Anyone got an nth root algorithm?
« Reply #3 on: November 02, 2019, 11:48:55 am »
Alas, no, Qwerkey: it was a moment of mathematical blindness, I'm afraid.  Things ill-remembered from 50 years ago, etc.  And probably badly learned, then -- slide rules for university exams were still the norm in my day, at least in my undergraduate years.

So thank you, bplus.  Much appreciated.

Malcolm

Offline bplus

  • Global Moderator
  • Forum Resident
  • Posts: 8053
  • b = b + ...
    • View Profile
Re: Anyone got an nth root algorithm?
« Reply #4 on: November 02, 2019, 12:16:40 pm »
Alas, no, Qwerkey: it was a moment of mathematical blindness, I'm afraid.  Things ill-remembered from 50 years ago, etc.  And probably badly learned, then -- slide rules for university exams were still the norm in my day, at least in my undergraduate years.

So thank you, bplus.  Much appreciated.

Malcolm

If it weren't for Basic coding, all my math lessons would be long gone.

Qwerkey, if you were hoping for an algorithm and don't remember my algorithm for power calculations (alas QB64 has it covered) I would be glad to share my discovery again :)

Offline MWheatley

  • Newbie
  • Posts: 64
    • View Profile
Re: Anyone got an nth root algorithm?
« Reply #5 on: November 03, 2019, 10:36:33 am »
Bplus,

I don't know the algorithms to which you refer, but please feel free to share them anyway.  I'm interested!  And I still code in QB45 as well as QB64.

MDW1954

Offline bplus

  • Global Moderator
  • Forum Resident
  • Posts: 8053
  • b = b + ...
    • View Profile
Re: Anyone got an nth root algorithm?
« Reply #6 on: November 03, 2019, 11:10:31 am »
Bplus,

I don't know the algorithms to which you refer, but please feel free to share them anyway.  I'm interested!  And I still code in QB45 as well as QB64.

MDW1954

Hi MWheatley,

If you missed the conversation, it was here:
https://www.qb64.org/forum/index.php?topic=364.msg2439#msg2439

Offline MWheatley

  • Newbie
  • Posts: 64
    • View Profile
Re: Anyone got an nth root algorithm?
« Reply #7 on: November 04, 2019, 05:54:33 am »
Thanks!

Malcolm