diff options
author | Bradley Smith | 2008-01-21 00:16:45 +0000 |
---|---|---|
committer | Bradley Smith | 2008-01-21 00:16:45 +0000 |
commit | e6e7222d5a730368ed4e84c2e0f55427460e5230 (patch) | |
tree | e608410401099ccebe7ffa21de9336d78c78efc9 /src/sign.c | |
download | gnurobots-e6e7222d5a730368ed4e84c2e0f55427460e5230.tar.gz |
Imported GNU robots from CVS.
Signed-off-by: Bradley Smith <brad@brad-smith.co.uk>
Diffstat (limited to 'src/sign.c')
-rw-r--r-- | src/sign.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/sign.c b/src/sign.c new file mode 100644 index 0000000..07c9d7a --- /dev/null +++ b/src/sign.c @@ -0,0 +1,16 @@ +#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); +} |