<feed xmlns='http://www.w3.org/2005/Atom'>
<title>rust/library/core/src/fmt/float.rs, branch 1.75.0</title>
<subtitle>https://github.com/rust-lang/rust
</subtitle>
<id>http://git.dreamy.place/mirrors/rust/atom?h=1.75.0</id>
<link rel='self' href='http://git.dreamy.place/mirrors/rust/atom?h=1.75.0'/>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/'/>
<updated>2023-05-15T18:31:00+00:00</updated>
<entry>
<title>Mark internal functions and traits unsafe</title>
<updated>2023-05-15T18:31:00+00:00</updated>
<author>
<name>LegionMammal978</name>
<email>mattlloydhouse@gmail.com</email>
</author>
<published>2023-05-15T18:31:00+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=77481099ca4be8fd8515d5e5bb873f3674cb7a2b'/>
<id>urn:sha1:77481099ca4be8fd8515d5e5bb873f3674cb7a2b</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Rollup merge of #86479 - exphp-forks:float-debug-exponential, r=yaahc</title>
<updated>2021-10-19T19:35:10+00:00</updated>
<author>
<name>Yuki Okushi</name>
<email>jtitor@2k36.org</email>
</author>
<published>2021-10-19T19:35:10+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=ca6798ab073c4f2358f2577e7258108099f29144'/>
<id>urn:sha1:ca6798ab073c4f2358f2577e7258108099f29144</id>
<content type='text'>
Automatic exponential formatting in Debug

Context: See [this comment from the libs team](https://github.com/rust-lang/rfcs/pull/2729#issuecomment-853454204)

---

Makes `"{:?}"` switch to exponential for floats based on magnitude. The libs team suggested exploring this idea in the discussion thread for RFC rust-lang/rfcs#2729. (**note:** this is **not** an implementation of the RFC; it is an implementation of one of the alternatives)

Thresholds chosen were 1e-4 and 1e16.  Justification described [here](https://github.com/rust-lang/rfcs/pull/2729#issuecomment-864482954).

**This will require a crater run.**

---

As mentioned in the commit message of 8731d4dfb47, this behavior will not apply when a precision is supplied, because I wanted to preserve the following existing and useful behavior of `{:.PREC?}` (which recursively applies `{:.PREC}` to floats in a struct):

```rust
assert_eq!(
    format!("{:.2?}", [100.0, 0.000004]),
    "[100.00, 0.00]",
)
```

I looked around and am not sure where there are any tests that actually use this in the test suite, though?

All things considered, I'm surprised that this change did not seem to break even a single existing test in `x.py test --stage 2`.  (even when I tried a smaller threshold of 1e6)
</content>
</entry>
<entry>
<title>Automatic exponential formatting in Debug</title>
<updated>2021-06-20T00:53:26+00:00</updated>
<author>
<name>Michael Lamparski</name>
<email>diagonaldevice@gmail.com</email>
</author>
<published>2021-06-19T19:50:29+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=8731d4dfb479914a91f650f4f124528e332e8128'/>
<id>urn:sha1:8731d4dfb479914a91f650f4f124528e332e8128</id>
<content type='text'>
* {:.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.
</content>
</entry>
<entry>
<title>Move `flt2dec::{Formatted, Part}` to dedicated module</title>
<updated>2021-06-06T01:54:51+00:00</updated>
<author>
<name>Gary Guo</name>
<email>gary@garyguo.net</email>
</author>
<published>2021-06-06T01:08:09+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=37647d1733c368dfb4a81f368cefa09adf6bf20d'/>
<id>urn:sha1:37647d1733c368dfb4a81f368cefa09adf6bf20d</id>
<content type='text'>
They are used by integer formatting as well and is not exclusive to float.
</content>
</entry>
<entry>
<title>Preserve signed zero on roundtrip</title>
<updated>2021-03-23T00:02:09+00:00</updated>
<author>
<name>Jubilee Young</name>
<email>workingjubilee@gmail.com</email>
</author>
<published>2020-10-31T20:16:14+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=74db93ed2d0677bbca8ba85617f05eae745363d8'/>
<id>urn:sha1:74db93ed2d0677bbca8ba85617f05eae745363d8</id>
<content type='text'>
This commit removes the previous mechanism of differentiating
between "Debug" and "Display" formattings for the sign of -0 so as
to comply with the IEEE 754 standard's requirements on external
character sequences preserving various attributes of a floating
point representation.

In addition, numerous tests are fixed.
</content>
</entry>
<entry>
<title>flt2dec: properly handle uninitialized memory</title>
<updated>2020-09-02T10:41:38+00:00</updated>
<author>
<name>Ralf Jung</name>
<email>post@ralfj.de</email>
</author>
<published>2020-09-02T10:18:07+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=56129d39c0d6f0e15e2f4fc40b8079b8b22e34fe'/>
<id>urn:sha1:56129d39c0d6f0e15e2f4fc40b8079b8b22e34fe</id>
<content type='text'>
</content>
</entry>
<entry>
<title>update fixmes</title>
<updated>2020-08-30T12:43:52+00:00</updated>
<author>
<name>DPC</name>
<email>dylan.dpc@gmail.com</email>
</author>
<published>2020-08-30T12:43:52+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=b3d7b7bdcbea782d15a34861acfb8c4bdb1b96c1'/>
<id>urn:sha1:b3d7b7bdcbea782d15a34861acfb8c4bdb1b96c1</id>
<content type='text'>
</content>
</entry>
<entry>
<title>rename get_{ref, mut} to assume_init_{ref,mut} in Maybeuninit</title>
<updated>2020-08-29T00:13:02+00:00</updated>
<author>
<name>DPC</name>
<email>dylan.dpc@gmail.com</email>
</author>
<published>2020-08-29T00:13:02+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=5e208efaa850efaa97495e81c49cf0f5767e8f49'/>
<id>urn:sha1:5e208efaa850efaa97495e81c49cf0f5767e8f49</id>
<content type='text'>
</content>
</entry>
<entry>
<title>mv std libs to library/</title>
<updated>2020-07-28T00:51:13+00:00</updated>
<author>
<name>mark</name>
<email>markm@cs.wisc.edu</email>
</author>
<published>2020-06-12T02:31:49+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=2c31b45ae878b821975c4ebd94cc1e49f6073fd0'/>
<id>urn:sha1:2c31b45ae878b821975c4ebd94cc1e49f6073fd0</id>
<content type='text'>
</content>
</entry>
</feed>
