diff options
| author | Michael Lamparski <diagonaldevice@gmail.com> | 2021-06-19 15:50:29 -0400 |
|---|---|---|
| committer | Michael Lamparski <diagonaldevice@gmail.com> | 2021-06-19 20:53:26 -0400 |
| commit | 8731d4dfb479914a91f650f4f124528e332e8128 (patch) | |
| tree | 3c9d8f12fb1f49e9984643adcf5b067b3b069434 /tests/codegen/src-hash-algorithm/src-hash-algorithm-md5.rs | |
| parent | 312b894cc12240a3fcc645474c3daa14f7d568ea (diff) | |
| download | rust-8731d4dfb479914a91f650f4f124528e332e8128.tar.gz rust-8731d4dfb479914a91f650f4f124528e332e8128.zip | |
Automatic exponential formatting in Debug
* {:.PREC?} already had legitimately useful behavior (recursive formatting of structs using
fixed precision for floats) and I suspect that changes to the output there would be unwelcome.
(besides, precision introduces sinister edge cases where a number can be rounded up to one
of the thresholds)
Thus, the new behavior of Debug is, "dynamically switch to exponential, but only if there's
no precision."
* This could not be implemented in terms of float_to_decimal_common without repeating the branch
on precision, so 'float_to_general_debug' is a new function. The name is '_debug' instead of
'_common' because the considerations in the previous bullet make this logic pretty specific
to Debug.
* 'float_to_decimal_common' is now only used by Display, so I inlined the min_precision argument
and renamed the function accordingly.
Diffstat (limited to 'tests/codegen/src-hash-algorithm/src-hash-algorithm-md5.rs')
0 files changed, 0 insertions, 0 deletions
