Skip to content

Commit

Permalink
Bugfix: gitlab issue #2: SGN(0) returned 1
Browse files Browse the repository at this point in the history
  • Loading branch information
kollokollo committed Aug 26, 2019
1 parent ebbf224 commit 4bd705c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
1 change: 0 additions & 1 deletion src/defs.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@
#endif
#define min(a,b) ((a<b)?a:b)
#define max(a,b) ((a>b)?a:b)
#define sgn(x) ((x<0)?-1:1)
#define rad(x) (PI*x/180)
#define deg(x) (180*x/PI)
#ifndef LOBYTE
Expand Down
6 changes: 5 additions & 1 deletion src/functions.c
Original file line number Diff line number Diff line change
Expand Up @@ -787,7 +787,11 @@ static int f_realloc(int adr,int size) {return(POINTER2INT(realloc((char *)IN
static double f_rnd(double d) {return((double)rand()/((double)RAND_MAX+1));}

static int f_size(STRING n) {return(stat_size(n.pointer)); }
static int f_sgn(double b) {return(sgn(b));}
static int f_sgn(double b) {
if(b>0.0) return 1;
if(b<0.0) return -1;
return 0;
}
static int f_srand(double d) {srand((int)d);return(0);}
static int f_succ(double b) {return((int)(b+1));}

Expand Down

0 comments on commit 4bd705c

Please sign in to comment.