Question: Doing a solve procedure

Hi there, 

 

I am trying do to a solve procedure, so you can solve an equation using the following argument. 

Solution(eqn, value, var) which uses the embedded solve command. 

When is an integer it works fine with this code here. 

MySolution:=proc(xl::algebraic,is::integer, x::algebraic)
return solve(xl=is,x);
    end proc; 

However the problem arises when I will like to make it to recognize is a an decimal number aka float. 

MySolution:=proc(xl::algebraic,is::integer, x::algebraic)
    return solve(xl=is,x);
    if type(is,float) then
return solve(xl=is,x);
    end proc; 

Any idears on what I am doing wrong? 

Many thanks in advance and have a nice day.

Please Wait...