WLJS LogoWLJS Notebook

Sign

Sign[x] gives 1-1, 00, or 11 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.

On this page