g.js — graphical objects for JavaScript

signsign

Take the sign of a number.

Positive values return 1:

g.sign(12);

Negative values return -1:

g.sign(-42);

Zero returns zero:

g.sign(0);