FreeBASIC
0.91.0
Main Page
Data Structures
Files
File List
Globals
math_sgn.c
Go to the documentation of this file.
1
/* SGN function */
2
3
#include "
fb.h
"
4
5
6
/*:::::*/
7
FBCALL
int
fb_SGNb
(
char
x )
8
{
9
if
( x == 0 )
10
return
0;
11
else
if
( x > 0 )
12
return
1;
13
else
14
return
-1;
15
}
16
17
/*:::::*/
18
FBCALL
int
fb_SGNi
(
int
x )
19
{
20
if
( x == 0 )
21
return
0;
22
else
if
( x > 0 )
23
return
1;
24
else
25
return
-1;
26
}
27
28
/*:::::*/
29
FBCALL
int
fb_SGNl
(
long
long
int
x )
30
{
31
if
( x == 0 )
32
return
0ll;
33
else
if
( x > 0ll )
34
return
1;
35
else
36
return
-1;
37
}
38
39
/*:::::*/
40
FBCALL
int
fb_SGNSingle
(
float
x )
41
{
42
if
( x == 0.0 )
43
return
0;
44
else
if
( x > 0.0 )
45
return
1;
46
else
47
return
-1;
48
}
49
50
/*:::::*/
51
FBCALL
int
fb_SGNDouble
(
double
x )
52
{
53
if
( x == 0.0 )
54
return
0;
55
else
if
( x > 0.0 )
56
return
1;
57
else
58
return
-1;
59
}
60
rtlib
math_sgn.c
Generated on Thu Jan 23 2014 19:40:12 for FreeBASIC by
1.8.4