00001 int signum(double x) 00002 { 00003 if(x>0) return 1; 00004 else if(x==0) return 0; 00005 else return -1; 00006 }