MCPcopy Create free account
hub / github.com/F-Stack/f-stack / round10

Function round10

freebsd/x86/cpufreq/hwpstate_intel.c:214–218  ·  view source on GitHub ↗

* Given x * 10 in [0, 1000], round to the integer nearest x. * * This allows round-tripping nice human readable numbers through this * interface. Otherwise, user-provided percentages such as 25, 50, 75 get * rounded down to 24, 49, and 74, which is a bit ugly. */

Source from the content-addressed store, hash-verified

212 * rounded down to 24, 49, and 74, which is a bit ugly.
213 */
214static inline int
215round10(int xtimes10)
216{
217 return ((xtimes10 + 5) / 10);
218}
219
220static inline int
221raw_to_percent(int x)

Callers 1

raw_to_percentFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected