TI-89 HomeGames ArchiveTitanium GamesGames How ToProgramsFAQForumTI-89 WikiLinks

Working with multiple answers

 
Post new topic   Reply to topic    Your TI-89 Resource Forum Index -> BASIC Programming
Author Message
blcArmadillo



Joined: 20 Oct 2007
Posts: 2

PostPosted: October 20, 2007 3:02 PM    Post subject: Working with multiple answers Reply with quote

Is there anyway that you can work with two answers? For example say you have:
Code:
solve((x+6)*(x-8)=0,x)


You get the answer:
Quote:
x = 8 or x = -6


But what if in your program you want to use those two answers and say add the number three to them to get x = 11 or x= -3. Can you do this with BASIC or would you have to write the program using assembly or C? Thanks for any help you guys can give me.
Back to top
View user's profile Send private message
mellamokb



Joined: 10 May 2007
Posts: 124

PostPosted: October 22, 2007 10:37 AM    Post subject: Reply with quote

Hi blcArmadillo,

Welcome to TI-89 Forums!

The TI-89 has a function called "part(" that allows you to select parts of an expression. The "part(" function takes two parameters: the expression, and which part. You can indicate which part by using the numbers 0, 1, or 2, where 0 represents the operator ("+", "-", "or", etc.) and 1, 2 represent the operands. For example:

Code:

part(j=5k+3,0)
"="
part(j=5k+3,1)
j
part(j=5k+3,2)
5k+3


So in your case, you could use part(x=8 or x=-6, 1) to get the left solution (x=Cool, and part(x=8 or x=-6, 2) to get the right solution (x=-6). Then you could apply the part function again to get the right sides of the two expressions "x=8" and "x=-6":

Code:

solve((x+6)*(x-8)=0,x)
x=8 or x=-6
part(ans(1), 1)
x=8
part(ans(1), 2)
8
part(ans(3), 2)
x=-6
part(ans(1),2)
-6
ans(1)+3
-9


Just experiment with the "part(" function, as it is a very powerful function capable of decomposing any expression in the calculator.

Hope this helps!

~ mellamokb
Back to top
View user's profile Send private message
Display posts from previous:    View previous topic : View next topic  
Post new topic   Reply to topic    Your TI-89 Resource Forum Index -> BASIC Programming All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

Contact Us | Privacy Policy | Disclaimer | Trademarks

Copyright ©2006 All rights reserved.


Free Greeting Cards | Girly Myspace Layouts | Myspace Unblocker |