ack/lang/basic/lib/sgn.c

18 lines
171 B
C
Raw Normal View History

#include "lib.h"
1984-11-29 14:22:02 +00:00
2016-12-12 20:15:25 +00:00
int _sgn(double v)
1984-11-29 14:22:02 +00:00
{
if (v > 0)
return (1);
if (v < 0)
return (-1);
return (0);
1984-11-29 14:22:02 +00:00
}
1988-07-01 17:30:06 +00:00
2016-12-12 20:15:25 +00:00
int _forsgn(double v)
1988-07-01 17:30:06 +00:00
{
if (v >= 0)
return 1;
1988-07-01 17:30:06 +00:00
return -1;
}