// n = your number // nSign = sign of your number
nSign = Math.round (Math.sin (n) * - 1);
/ * Math.sin returns a number from -1 to 1. You must round it to get a non-DEC number. This number will be the opposite of what your number is. Multiply it by -1 * /
// or you could just do it
Math.round (Math.sin (/ n /) * - 1)
source share