static int sign(double x) { ret x == 0.0 ? 0 : x < 0 ? -1 : 1; } static int sign(long x) { ret x == 0 ? 0 : x < 0 ? -1 : 1; } static int sign(int x) { ret x == 0 ? 0 : x < 0 ? -1 : 1; }