Logo Search packages:      
Sourcecode: inkscape version File versions

template<class T>
int Geom::sgn ( const T &  x  )  [inline]

Sign function - indicates the sign of a numeric type. -1 indicates negative, 1 indicates positive, and 0 indicates, well, 0. Mathsy people will know this is basically the derivative of abs, except for the fact that it is defined on 0.

Definition at line 48 of file utils.h.

{return (x < 0 ? -1 : (x > 0 ? 1 : 0) );}


Generated by  Doxygen 1.6.0   Back to index