File: floatunsidf.c

package info (click to toggle)
gccxml 0.9.0%2Bcvs20080525-1
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 78,840 kB
  • ctags: 72,674
  • sloc: ansic: 749,255; cpp: 33,564; asm: 26,833; sh: 5,161; makefile: 4,695; lex: 589; awk: 566; perl: 334; yacc: 271; pascal: 86; python: 18
file content (15 lines) | stat: -rw-r--r-- 412 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
/* Public domain.  */
typedef int SItype __attribute__ ((mode (SI)));
typedef unsigned int USItype __attribute__ ((mode (SI)));
typedef float DFtype __attribute__ ((mode (DF)));

DFtype
__floatunsidf (USItype u)
{
  SItype s = (SItype) u;
  DFtype r = (DFtype) s;
  if (s < 0)
    r += (DFtype)2.0 * (DFtype) ((USItype) 1
                                 << (sizeof (USItype) * __CHAR_BIT__ - 1));
  return r;
}