+/** Return the complex half-plane (left or right) in which the number lies.
+ * csgn(x)==0 for x==0, csgn(x)==1 for Re(x)>0 or Re(x)=0 and Im(x)>0,
+ * csgn(x)==-1 for Re(x)<0 or Re(x)=0 and Im(x)<0.
+ *
+ * @see numeric::compare(numeric const & other) */
+int numeric::csgn(void) const
+{
+ if (is_zero())
+ return 0;
+ if (!zerop(realpart(*value))) {
+ if (plusp(realpart(*value)))
+ return 1;
+ else
+ return -1;
+ } else {
+ if (plusp(imagpart(*value)))
+ return 1;
+ else
+ return -1;
+ }
+}
+