From e6e7222d5a730368ed4e84c2e0f55427460e5230 Mon Sep 17 00:00:00 2001 From: Bradley Smith Date: Mon, 21 Jan 2008 00:16:45 +0000 Subject: Imported GNU robots from CVS. Signed-off-by: Bradley Smith --- src/sign.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 src/sign.c (limited to 'src/sign.c') 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 +#include + +/* 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); +} -- cgit v1.1