Question: best way to check if solve returned one or more than one solution

What is the best way to check if solve returned one or more solution? Currently I check if the returned sol is of type exprseq, and if so, I put the result in a list. If the sol is not of type exprseq, then I know only one solution is returned. Here is an example

foo:=proc(eq,x)
  local sol;
  sol:=solve(eq,x);
  if whattype(sol)='exprseq' then
     sol:=[sol];
  fi;
  return(sol);
end proc:

And now

Is there better way to do this?

 

Please Wait...