1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
/* TODO: Either this needs to go, or it needs a copyright header */ #include <stdio.h> #include <glib.h> /* is there a standard C function to do this? */ gint sign (gint n) { if (n < 0) { return (-1); } else if (n > 0) { return (+1); } return (0); }