This is an archived, read-only copy of the United-TI subforum , including posts and topic from May 2003 to April 2012. If you would like to discuss any of the topics in this forum, you can visit Cemetech's TI-BASIC subforum. Some of these topics may also be directly-linked to active Cemetech topics. If you are a Cemetech member with a linked United-TI account, you can link United-TI topics here with your current Cemetech topics.

This forum is locked: you cannot post, reply to, or edit topics. TI-Basic => TI-BASIC
United-TI Archives -> TI-Basic
 
    » Goto page Previous  1, 2
» View previous topic :: View next topic  
Author Message
DarkerLine
ceci n'est pas une |


Super Elite (Last Title)


Joined: 04 Nov 2003
Posts: 8328

Posted: 26 Feb 2010 07:40:31 pm    Post subject:

The idea with Horner's rule is that when you're trying to figure out, say Ax3+Bx2+Cx+D, you will do something of the following (in pseudocode)

Set Result = 0
Set Result = Result*x+A (getting A)
Set Result = Result*x+B (getting Ax+B)
Set Result = Result*x+C (getting Ax2+Bx+C)
Set Result = Result*x+D (getting Ax3+Bx2+Cx+D)

Note how all of the steps you do are the same. When we put them in a For( loop, replace x by 2 (for binary), and replace A, B, C, D, etc. by the binary digits of the number we're converting, we get precisely the code in thornahawk's post.


Last edited by Guest on 26 Feb 2010 07:40:47 pm; edited 1 time in total
Back to top
meishe91


Newbie


Joined: 06 Dec 2009
Posts: 49

Posted: 26 Feb 2010 10:43:38 pm    Post subject:

DarkerLine wrote:
The idea with Horner's rule is that when you're trying to figure out, say Ax3+Bx2+Cx+D, you will do something of the following (in pseudocode)

Set Result = 0
Set Result = Result*x+A (getting A)
Set Result = Result*x+B (getting Ax+Cool
Set Result = Result*x+C (getting Ax2+Bx+C)
Set Result = Result*x+D (getting Ax3+Bx2+Cx+D)

Note how all of the steps you do are the same. When we put them in a For( loop, replace x by 2 (for binary), and replace A, B, C, D, etc. by the binary digits of the number we're converting, we get precisely the code in thornahawk's post.

Hmmm...ok. Well that does make a little more sense, I'm not sure what isn't clicking for me. Ugh haha. Sad
Back to top
Display posts from previous:   
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
    » Goto page Previous  1, 2
» View previous topic :: View next topic  
Page 2 of 2 » All times are UTC - 5 Hours

 

Advertisement