Question: Spot error with Interactive Debugger

In following procedure the error is %d in statement printf("radian = %d\n",evalf(a*Pi/180));

The %d (signed decimal integer format) needs to be changed to

%a (algebraic format), %f (fixed point number format), or %E (scientific notation).

How can this error be spotted using the Interactive Debugger?  When I open the I-Debugger and choose list, then next, then list the results shown below are displayed.  But nothing I could see in the I-Debugger output points to the error (i.e. line number and position of problem in the statement…or even, just statement where the error is).  What can I enter in the I-Debugger or the Maple Worksheet that will help me spot this error?

restart;
cav1 := proc (a)

     printf("degree = %f\n", a);

     printf("radian = %d\n", evalf((1/180)*a*Pi));

end proc;


cav1(260);
degree = 260.000000
radian =

Error, (in fprintf) integer expected for integer format


stopat(cav1);
                             [cav1]
cav1(260);


degree = 260.000000

radian =

 

 stopat(cav1) and cav1(260) open the Interactive Debugger

cav1:

   1*  printf("degree = %f\n",a);

command list in Interactive Debugger executed

cav1 := proc(a)

   1*! printf("degree = %f\n",a);

   2   printf("radian = %d\n",evalf(1/180*a*Pi))

end proc

command next in Interactive Debugger executed

cav1:

   2   printf("radian = %d\n",evalf(1/180*a*Pi))

Command list in Interactive Debugger executed

cav1 := proc(a)

   1*  printf("degree = %f\n",a);

   2 ! printf("radian = %d\n",evalf(1/180*a*Pi))

end proc

============================================

 

Please Wait...