Question: Illegal use of a formal parameter

I'm writing this procedure to calculate a Julian date:

JD := proc (YY, MM, DD)

local A, B, z;

if MM = 1 or MM = 2 then

YY := YY-1; MM := MM+12

end if;

A := floor((1/100)*YY);

B := 2-A+floor((1/4)*A);

z := evalf(floor(365.25*YY)+floor(30.6001*(MM+1))+DD+1720994.5) end proc;

If I type:

JD(2018, 1, 11);  I get
Error, (in JD) illegal use of a formal parameter.

I cannot see where the illegal use is or why I get this message. I don't think I use anything out of the ordinary.

Could you help me please?

 

Thank you

 

Please Wait...