projects
/
debian
/
cc1111
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
history
|
raw
|
HEAD
Imported Upstream version 2.9.0
[debian/cc1111]
/
device
/
lib
/
pic16
/
libsdcc
/
fixed16x16
/
fps16x162sfloat.c
1
2
float __fps16x162sfloat(__fixed16x16 fixd)
3
{
4
union {
5
__fixed16x16 fix;
6
unsigned long value;
7
} u;
8
float tmp=0, exp=2;
9
10
u.fix = fixd;
11
tmp = (u.value & 0xffff0000) >> 16;
12
13
while(u.value) {
14
u.value &= 0xffff;
15
if(u.value & 0x8000)tmp += 1/exp;
16
exp *= 2;
17
u.value <<= 1;
18
}
19
20
return (tmp);
21
}