about summary refs log tree commit diff
path: root/src/test/codegen/src-hash-algorithm
diff options
context:
space:
mode:
authorMichael Lamparski <diagonaldevice@gmail.com>2021-06-19 15:50:29 -0400
committerMichael Lamparski <diagonaldevice@gmail.com>2021-06-19 20:53:26 -0400
commit8731d4dfb479914a91f650f4f124528e332e8128 (patch)
tree3c9d8f12fb1f49e9984643adcf5b067b3b069434 /src/test/codegen/src-hash-algorithm
parent312b894cc12240a3fcc645474c3daa14f7d568ea (diff)
downloadrust-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 'src/test/codegen/src-hash-algorithm')
0 files changed, 0 insertions, 0 deletions