restart; interface(version);
    Classic Worksheet Interface, Maple 12.02, Windows, Dec 10 2008 Build ID 377066

  # intended to be used for Reals
  p:= y -> PIECEWISE([-1, y < 0],[1, 0 <= y]);

                               { -1        y < 0
                     p := y -> {
                               { 1         0 <= y

  p(y):
  convert(%, abs); 
  convert(%, signum);    # for real and complex
  convert(%, piecewise); # seems to consider y as a Real 

                                | y |
                                -----
                                  y


                                  1
                              ---------
                              signum(y)


                       {    -1            y < 0
                       {
                       { undefined        y = 0
                       {
                       {     1            0 < y


Already the first conversion makes not much sense for y=0.
Then it seems, that silently Maple works as if y is a Real.
Finally the value in y=0 is forgotten.


Now explicitly say that y is a Real:

  restart;
  p:= y -> PIECEWISE([-1, y < 0],[1, 0 <= y]);

  assume(y::real); getassumptions(y);

                              {y::real}

  p(y):
  convert(%, abs); 
  convert(%, signum);
  convert(%, piecewise);

                                | y |
                                -----
                                  y


                              signum(y)


                          { -1        y < 0
                          {
                          { 0         y = 0
                          {
                          { 1         0 < y

Which now is false for y=0.

Please Wait...