Question: Problem using boolean operators


i was stuck with some simple problem. I tried using if condition in program that involves a truth condition. If maple cannot determine the condition is true or false i want to assign o to a particular varable. I  show a similar program.



h[1] := -1;

for i from 1 by 1 while(i<150 and h[i]<0) do

p1[i] := .989347189582843*x^2-0.139423979061219e-1*x-1.82559474469870*10^8*x^15+1.30761381361453*10^8*x^16-6.88520063191821*10^7*x^17+2.51079317463498*10^7*x^18-5.66094206949155*10^6*x^19+5.94129446612678*10^5*x^20-6812.74182685426*x^5+59230.0931084044*x^6-3.83520584559500*10^5*x^7+1.90126822307036*10^6*x^8-7.34991883857609*10^6*x^9+2.24203561757434*10^7*x^10-5.43284775909785*10^7*x^11+1.04806113793011*10^8*x^12-1.60600324339222*10^8*x^13+1.94090536353833*10^8*x^14+559.557918804679*x^4-30.6576714427729*x^3-3.93727537464007*10^(-15)-i^2-i; fsolve(p1[i]-0.312e-1, x, -1 .. 1);

if fsolve(p1[i]-0.312e-1, x, -.2 .. 0) < 0 then h[i+1] := fsolve(p1[i]-0.312e-1, x, -.2 .. 0) elif FAIL then h[i+1] := 0 end if;

print(i, h[i])

end do;

i got an error message

Error, cannot determine if this expression is true or false: () < 0

how can i get a value of 0 for h[i] if the error comes.





Please Wait...