Code:

//Dialog box for input
expr(ex)→ex
expr(lower)→lower
expr(upper)→upper
d(ex,x)→der
exp►list(solve(der=0,x)|x>lower and x<upper,x)→crit
crit→sol
exp►list(solve(getDenom(der)=0,x)|x>lower and x<upper,x)→uncrit
augment(uncrit,crit)→crit
augment({lower,upper},crit)→crit
approx(crit)→crita
SortA crita,crit
SortA sol
newList(0)→test
For i,1,dim(crit)-1
 If crit[i]=lower Then //error occurs here
 //do stuff


Why does test not return true or false? Thanks!
This usually happens when there are undefined variables in the expressions being compared, so that the expressions don't fully break down into numbers for comparison. You might add a temporarily “Disp crit[i]=lower” just before the If test to see what the calculator is trying to compare. If the displayed expression has variable names or non-fully-evaluated expressions instead of just “true” or “false”, I'd check for variables that aren't getting defined somehow.
I got a the following response

true
false
false
@8=0

ex equals 2sin(x)
lower equals 0
upper equals 2π
  
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
Page 1 of 1
» All times are UTC - 5 Hours
 
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

 

Advertisement