projects
/
fw
/
sdcc
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
history
|
raw
|
HEAD
Cleared the top bytes for use in arrays.
[fw/sdcc]
/
device
/
lib
/
_fs2slong.c
1
#include <limits.h>
2
3
/* convert float to signed long */
4
signed long __fs2slong (float f) {
5
6
if (!f)
7
return 0;
8
9
if (f<0) {
10
if (f<=LONG_MIN)
11
return LONG_MIN;
12
return -__fs2ulong(-f);
13
} else {
14
if (f>=LONG_MAX)
15
return LONG_MAX;
16
return __fs2ulong(f);
17
}
18
}