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.
68k Calculator Basic =>
TI-BASIC
Author |
Message |
|
albisher
Newbie
Joined: 02 May 2006 Posts: 14
|
Posted: 15 May 2006 04:39:28 am Post subject: |
|
|
i did write a program for the "bisection" in numerical methods for engineering
Code: Prgm
ClrIO
Local xr,it,fl,fr,xl,xr,xo,er
1it
0xr
Disp "Bisection Method"
Disp ":"
Disp "Remember to in f(x)"
Input "xl=",xl
Input "xu=",xu
Lbl bgn
Pause
ClrIO
xrxo
(xl+xu)/2xr
f(xl)fl
f(xr)fr
abs(xr-xo)/xrer
Disp "it="&string(it)
Disp "xl="&string(xl)
Disp "xu="&string(xu)
Disp "xr="&string(xr)
Pause
ClrIO
Disp "f(xl)="&string(fl)
Disp "f(xr)="&string(fr)
er*100er
Disp "er="&string(er)
If fl*fr<0 Then
xrxu
Else
xrxl
EndIf
it+1it
Goto bgn
EndPrgm
you may notice the looping i am using here is an infinite loop
i need a way to make the calculator stop if user press "esc" normally without the brakeing error that is shown when i press "enter"
thanks for your help |
|
Back to top |
|
|
Ray Kremer
Member
Joined: 16 Feb 2004 Posts: 237
|
Posted: 15 May 2006 01:10:07 pm Post subject: |
|
|
If you've just got a Lbl-Goto loop, you can break out of it with another Goto, maybe tied into a Getkey line. Most people prefer While-EndWhile loops, which you can also tie in to exit on a getkey. |
|
Back to top |
|
|
|
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