From 501671487f53bad2f9f70542fdc53432c9f07ef9 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Fredrik=20H=C3=BCbinette=20=28Hubbe=29?= <hubbe@hubbe.net>
Date: Mon, 2 Feb 1998 21:30:34 -0800
Subject: [PATCH] sgn() fixed

Rev: src/modules/math/math.c:1.8
---
 src/modules/math/math.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/modules/math/math.c b/src/modules/math/math.c
index be4b7fdc4e..3641a11bbb 100644
--- a/src/modules/math/math.c
+++ b/src/modules/math/math.c
@@ -174,12 +174,12 @@ void f_sgn(INT32 args)
   check_all_args("sgn",args,BIT_MIXED,BIT_VOID|BIT_MIXED,0);
   if(args<2) push_int(0);
 
-  if(is_lt(sp-args,&zero))
+  if(is_lt(sp-2,sp-1))
   {
     pop_n_elems(2);
     push_int(-1);
   }
-  else if(is_gt(sp-1,&zero))
+  else if(is_gt(sp-2,sp-1))
   {
     pop_n_elems(2);
     push_int(1);
-- 
GitLab