Commit Graph

4 Commits

Author SHA1 Message Date
Andrew Tribick
aa9837ba29 Add tests for rounding of ties during float formatting 2022-10-20 22:09:24 +02:00
Andrew Tribick
848744403a Fix inconsistent rounding of 0.5 when formatted to 0 decimal places 2022-10-11 23:09:23 +02:00
Michael Lamparski
8731d4dfb4 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.
2021-06-19 20:53:26 -04:00
mark
2c31b45ae8 mv std libs to library/ 2020-07-27 19:51:13 -05:00