Sign
Sign[x] gives , , or depending on whether x is negative, zero, or positive.
Examples
Get the sign of numbers:
Sign[-5]
(* -1 *)
Sign[0]
(* 0 *)
Sign[3.14]
(* 1 *)
(* Apply to a list *)
Sign[{-2, 0, 5}]
(* {-1, 0, 1} *)Please visit the official Wolfram Language Reference for more details.