@@ -93,7 +93,7 @@ Both implementations expose two public functions:
9393
9494They try to fill the `u8` buffer with digits and returns the number of digits
9595written and the exponent `k`. They are total for all finite `f32` and `f64`
96- inputs (Grisu internally falls back to Dragon if possible ).
96+ inputs (Grisu internally falls back to Dragon if necessary ).
9797
9898The rendered digits are formatted into the actual string form with
9999four functions:
@@ -114,8 +114,8 @@ four functions:
114114They all return a slice of preallocated `Part` array, which corresponds to
115115the individual part of strings: a fixed string, a part of rendered digits,
116116a number of zeroes or a small (`u16`) number. The caller is expected to
117- provide an enough buffer and `Part` array, and to assemble the final
118- string from parts itself.
117+ provide a large enough buffer and `Part` array, and to assemble the final
118+ string from resulting `Part`s itself.
119119
120120All algorithms and formatting functions are accompanied by extensive tests
121121in `coretest::num::flt2dec` module. It also shows how to use individual
@@ -639,9 +639,8 @@ pub fn to_exact_fixed_str<'a, T, F>(mut format_exact: F, v: T,
639639 let limit = if frac_digits < 0x8000 { -( frac_digits as i16 ) } else { i16:: MIN } ;
640640 let ( len, exp) = format_exact ( decoded, & mut buf[ ..maxlen] , limit) ;
641641 if exp <= limit {
642- // `format_exact` always returns at least one digit even though the restriction
643- // hasn't been met, so we catch this condition and treats as like zeroes.
644- // this does not include the case that the restriction has been met
642+ // the restriction couldn't been met, so this should render like zero no matter
643+ // `exp` was. this does not include the case that the restriction has been met
645644 // only after the final rounding-up; it's a regular case with `exp = limit + 1`.
646645 debug_assert_eq ! ( len, 0 ) ;
647646 if frac_digits > 0 { // [0.][0000]
0 commit comments