Changeset 777 for soft/giet_vm/giet_libs/math/s_rint.c
- Timestamp:
- Feb 4, 2016, 6:25:22 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
soft/giet_vm/giet_libs/math/s_rint.c
r581 r777 35 35 { 36 36 int32_t i0, j0, sx; 37 u _int32_t i,i1;37 uint32_t i,i1; 38 38 double t; 39 39 /* We use w = x + 2^52; t = w - 2^52; trick to round x to integer. … … 47 47 EXTRACT_WORDS(i0,i1,x); 48 48 /* Unbiased exponent */ 49 j0 = ((((u _int32_t)i0) >> 20)&0x7ff)-0x3ff;49 j0 = ((((uint32_t)i0) >> 20)&0x7ff)-0x3ff; 50 50 51 51 if (j0 > 51) { … … 57 57 58 58 /* Sign */ 59 sx = ((u _int32_t)i0) >> 31;59 sx = ((uint32_t)i0) >> 31; 60 60 61 61 if (j0<20) { … … 81 81 } 82 82 } else { 83 i = ((u _int32_t)(0xffffffff))>>(j0-20);83 i = ((uint32_t)(0xffffffff))>>(j0-20); 84 84 if ((i1&i)==0) return x; /* x is integral */ 85 85 i>>=1;
Note: See TracChangeset
for help on using the changeset viewer.