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