sign returns a vector with the signs of the corresponding
x (the sign of a real number is 1, 0, or -1
if the number is positive, zero, or negative, respectively).
sign does not operate on complex vectors.
a numeric vector
This is an internal generic primitive function: methods
can be defined for it directly or via the
Math group generic.
sign(pi) # == 1 sign(-2:3) # -1 -1 0 1 1 1
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.