+/* Generate into P[-1] (and possibly P[-2]) the proper suffix for
+ POWER and BASE. Return the address of the generated suffix. */
+static char *
+generate_suffix_backwards (char *p, int power, int base)
+{
+ char letter = suffixes[power];
+
+ if (base == 1000)
+ {
+ *--p = 'B';
+ if (power == 1)
+ letter = 'k';
+ }
+
+ *--p = letter;
+ return p;
+}
+
+/* If INEXACT_STYLE is not human_round_to_even, and if easily
+ possible, adjust VALUE according to the style. */
+static double
+adjust_value (enum human_inexact_style inexact_style, double value)
+{
+ /* Do not use the floor or ceil functions, as that would mean
+ linking with the standard math library, which is a porting pain.
+ So leave the value alone if it is too large to easily round. */
+ if (inexact_style != human_round_to_even && value < (uintmax_t) -1)
+ {
+ uintmax_t u = value;
+ value = u + (inexact_style == human_ceiling && u != value);
+ }
+
+ return value;
+}
+