code: public static void sortSpecial(final double[] d)
      {
          boolean flip;
          double temp;
  
          do
          {
              flip = false;
              for (int i = 0; i < (d.length - 1); i++)
              {
                  if (((d[i + 1] >= 0) && (d[i] > d[i + 1])) || ((d[i] < 0) && (d[i + 1] >= 0)))
                  {
                      flip = true;
                      temp = d[i];
                      d[i] = d[i + 1];
                      d[i + 1] = temp;
                  }
              }
          }
          while (flip);
      }
docs: sort, but place -1 at the end
  @param d