// Math.sign(n) function M_sign(n){ if(n==0){ return 0; } if(n<0){ return -1; } return 1; } // Sample Code log(M_sign(0),"\n"); log(M_sign(1234),"\n"); log(M_sign(-456), "\n");