Question: I have a problem with "if"

Dear all,

 I have a problem in programming with maple if statement:

 restart;Qs:=24; p:=20; m:=3; q:=Qs/(2*p*m); if (q=1) then
> yc:=Qs/(2*p); elif (frem(q,1)~=0) then if (evalf(Qs/(2*p))<1) then
> yc:=1; else yc:=floor(Qs/(2*p)); end if; else yc:=round(0.8*Qs/(2*p)); end if; 

The result is yc:=0; the result must be yc:=1;

 In Matlab:

 clear all p=20; Qs=24; m=3; q=Qs/(2*p*m);   if q==1 then yc=Qs/(2*p); elseif mod(q,1)~=0 if Qs/(2*p)<1 yc=1; else c=floor(Qs/(2*p)); end else yc=round(0.8*Qs/(2*p)); end

the result is yc=1;

Thanks for your help to find my error in maple programm

Best regards

Kamel

Please Wait...