You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The comments for flt2dec::to_shortest and other similar functions describe the required size of the &mut [Part] parameters. However, the assertions contained in those functions do not check the size described in the comments:
to_shortest_str requires 5 in the comments, but asserts that the size is >= 4;
to_exact_fixed_str does the same.
The comments appear to be confused, as the [0.] bit that they are apparently counting as a Part is not; perhaps this is a remnant left over from a previous refactoring.
to_shortest_exp_str requires 7 in the comments, but asserts that the size is >= 6;
to_exact_exp_str does the same.
The comments suggest that the worst case for the exponent would require 17 bits or more, which seems overly conservative.
The text was updated successfully, but these errors were encountered:
froydnj
added a commit
to froydnj/rust
that referenced
this issue
May 9, 2017
The documentation for flt2dec doesn't match up with the actual
implementation, so fix the documentation to align with reality.
Presumably due to the mismatch, the formatting code for floats in
std::fmt can use correspondingly shorter arrays in some places, so fix
those places up as well.
Fixesrust-lang#41304.
fix confusion about parts required for float formatting
The documentation for flt2dec doesn't match up with the actual
implementation, so fix the documentation to align with reality.
Presumably due to the mismatch, the formatting code for floats in
std::fmt can use correspondingly shorter arrays in some places, so fix
those places up as well.
Fixesrust-lang#41304.
fix confusion about parts required for float formatting
The documentation for flt2dec doesn't match up with the actual
implementation, so fix the documentation to align with reality.
Presumably due to the mismatch, the formatting code for floats in
std::fmt can use correspondingly shorter arrays in some places, so fix
those places up as well.
Fixes#41304.
The comments for
flt2dec::to_shortest
and other similar functions describe the required size of the&mut [Part]
parameters. However, the assertions contained in those functions do not check the size described in the comments:to_shortest_str
requires 5 in the comments, but asserts that the size is>= 4
;to_exact_fixed_str
does the same.The comments appear to be confused, as the
[0.]
bit that they are apparently counting as aPart
is not; perhaps this is a remnant left over from a previous refactoring.to_shortest_exp_str
requires 7 in the comments, but asserts that the size is>= 6
;to_exact_exp_str
does the same.The comments suggest that the worst case for the exponent would require 17 bits or more, which seems overly conservative.
The text was updated successfully, but these errors were encountered: