Changeset 8565a42 in mainline for uspace/lib/math/generic/trunc.c
- Timestamp:
- 2018-03-02T20:34:50Z (7 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- a1a81f69, d5e5fd1
- Parents:
- 3061bc1 (diff), 34e1206 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - git-author:
- Jiří Zárevúcky <zarevucky.jiri@…> (2018-03-02 20:34:50)
- git-committer:
- GitHub <noreply@…> (2018-03-02 20:34:50)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/math/generic/trunc.c
r3061bc1 r8565a42 56 56 float32_u v; 57 57 int32_t exp; 58 58 59 59 v.val = val; 60 60 exp = v.data.parts.exp - FLOAT32_BIAS; 61 61 62 62 if (exp < 0) { 63 63 /* -1 < val < 1 => result is +0 or -0 */ … … 69 69 // FIXME TODO 70 70 } 71 71 72 72 /* All bits in val are relevant for the result */ 73 73 } else { … … 75 75 v.data.parts.fraction &= ~(UINT32_C(0x007fffff) >> exp); 76 76 } 77 77 78 78 return v.val; 79 79 } … … 98 98 float64_u v; 99 99 int32_t exp; 100 100 101 101 v.val = val; 102 102 exp = v.data.parts.exp - FLOAT64_BIAS; 103 103 104 104 if (exp < 0) { 105 105 /* -1 < val < 1 => result is +0 or -0 */ … … 111 111 // FIXME TODO 112 112 } 113 113 114 114 /* All bits in val are relevant for the result */ 115 115 } else { … … 117 117 v.data.parts.fraction &= ~(UINT64_C(0x000fffffffffffff) >> exp); 118 118 } 119 119 120 120 return v.val; 121 121 }
Note:
See TracChangeset
for help on using the changeset viewer.