Changeset e3272101 in mainline for uspace/lib/c/generic
- Timestamp:
- 2019-02-11T14:08:52Z (7 years ago)
- Children:
- d5a89a3
- Parents:
- aa57bf7
- Location:
- uspace/lib/c/generic
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/c/generic/cap.c
raa57bf7 re3272101 160 160 161 161 /* Round the number so that we have at most @c scap_max_sdig significant digits */ 162 sdig = 1 + ilog10_u64(cap->m); /* number of significant digits */ 162 rc = ilog10_u64(cap->m, &sdig); /* number of significant digits */ 163 sdig += 1; 164 assert(rc == EOK); 163 165 if (sdig > scap_max_sdig) { 164 166 /* Number of digits to remove */ -
uspace/lib/c/generic/imath.c
raa57bf7 re3272101 81 81 * 82 82 * @param v Value to compute logarithm from 83 * @param res Place to store result 84 * @return EOK on success 83 85 * @return Logarithm value 84 86 */ 85 unsigned ilog10_u64(uint64_t v)87 errno_t ilog10_u64(uint64_t v, unsigned *res) 86 88 { 89 if (v == 0) 90 return ERANGE; 91 87 92 unsigned b; 88 93 unsigned e; … … 117 122 } 118 123 119 return r; 124 *res = r; 125 return EOK; 120 126 } 121 127
Note:
See TracChangeset
for help on using the changeset viewer.
