| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
|||
|
Formula of Bolzano
Hi there
Today @ math we learned a new formula, it's like typing alwasy the same thing over again, to get closer to a point. Now i thougt to put it in a program, but the program won't work. What i got is this: (A+B)/2 => M Y1(M) => C If C>0 Then M => B Else M => A Disp "A=",A Disp "B=",B Disp "M=",M Disp "F(m)=",C The problem is in the if-then-else part.. When F(m) outcomes negative, it should store M in A, when it turns op postive it should store it in B.. The problem is, it won't Disp anything? :s |
|
|||
|
What i figured out now, it SOMETIMES gives the Displays.. sometimes it just says Done without giving nothing.. What's causing this bug?
|
|
|||
|
For the ones who wanna figure it out, stop here, because i got it already, sorry for making the forum dirty for it
![]() I had to add an end in it, because in the first version, it only displays when it's negative.. Programming is just logics i guess ![]() (A+B)/2 => M Y1(M) => C If C>0 Then M => B Else M => A End Disp "A=",A Disp "B=",B Disp "M=",M Disp "F(m)=",C |
|
||||
|
check this out!
Code:
Lbl 1 Prompt A,B If abs(Y1(A))=Y1(A):1->K If abs(Y1(A))[notequal]Y1(A):0->K If abs(Y1(B))=Y1(B):1->J If abs(Y1(B))[notequal]Y1(B):0->J If K=J Then Disp "No sign change" Goto 1 Else Lbl 2 (A+B)/2->C Y1(C)->M If abs(Y1(C))=Y1(C):1->Z If abs(Y1(C))[notequal]Y1(C):0->Z Disp "A",A Disp "B",B Disp "C",C Disp "Y1(C)",M Pause If Z=K Then C->A Else C->B End Goto 2 End |
![]() |
| Viewing: Dev Hardware Forums > SOFTWARE > TI 83/84 > Formula of Bolzano |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|