<feed xmlns='http://www.w3.org/2005/Atom'>
<title>rust/library/core/src/fmt/float.rs, branch 1.84.0</title>
<subtitle>https://github.com/rust-lang/rust
</subtitle>
<id>http://git.dreamy.place/mirrors/rust/atom?h=1.84.0</id>
<link rel='self' href='http://git.dreamy.place/mirrors/rust/atom?h=1.84.0'/>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/'/>
<updated>2024-11-12T06:47:26+00:00</updated>
<entry>
<title>remove no-longer-needed abs_private</title>
<updated>2024-11-12T06:47:26+00:00</updated>
<author>
<name>Ralf Jung</name>
<email>post@ralfj.de</email>
</author>
<published>2024-11-12T06:22:49+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=2d3c08a02216693f26b5a8c3c44bb8a6be8abc0b'/>
<id>urn:sha1:2d3c08a02216693f26b5a8c3c44bb8a6be8abc0b</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Refactor `floating` macro and nofloat panic message</title>
<updated>2024-10-15T13:27:06+00:00</updated>
<author>
<name>zlfn</name>
<email>ung@zlfn.space</email>
</author>
<published>2024-10-15T09:39:30+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=99af761632420b2778e2b44465a396e28adf6103'/>
<id>urn:sha1:99af761632420b2778e2b44465a396e28adf6103</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Reformat `use` declarations.</title>
<updated>2024-07-28T22:26:52+00:00</updated>
<author>
<name>Nicholas Nethercote</name>
<email>n.nethercote@gmail.com</email>
</author>
<published>2024-07-28T22:13:50+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=84ac80f1921afc243d71fd0caaa4f2838c294102'/>
<id>urn:sha1:84ac80f1921afc243d71fd0caaa4f2838c294102</id>
<content type='text'>
The previous commit updated `rustfmt.toml` appropriately. This commit is
the outcome of running `x fmt --all` with the new formatting options.
</content>
</entry>
<entry>
<title>Replace `MaybeUninit::uninit_array()` with array repeat expression.</title>
<updated>2024-06-24T17:23:50+00:00</updated>
<author>
<name>Kevin Reid</name>
<email>kpreid@switchb.org</email>
</author>
<published>2024-05-13T04:37:53+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=13fca73f4937fe4bb318321525a0fd666e9da16e'/>
<id>urn:sha1:13fca73f4937fe4bb318321525a0fd666e9da16e</id>
<content type='text'>
This is possible now that inline const blocks are stable; the idea was
even mentioned as an alternative when `uninit_array()` was added:
&lt;https://github.com/rust-lang/rust/pull/65580#issuecomment-544200681&gt;

&gt; if it’s stabilized soon enough maybe it’s not worth having a
&gt; standard library method that will be replaceable with
&gt; `let buffer = [MaybeUninit::&lt;T&gt;::uninit(); $N];`

Const array repetition and inline const blocks are now stable (in the
next release), so that circumstance has come to pass, and we no longer
have reason to want `uninit_array()` other than convenience. Therefore,
let’s evaluate the inconvenience by not using `uninit_array()` in
the standard library, before potentially deleting it entirely.
</content>
</entry>
<entry>
<title>Add a `Debug` impl and some basic functions to `f16` and `f128`</title>
<updated>2024-04-11T19:31:10+00:00</updated>
<author>
<name>Trevor Gross</name>
<email>tmgross@umich.edu</email>
</author>
<published>2024-04-11T09:10:37+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=5159ecd9220b505343a5744e01b61825cb734fef'/>
<id>urn:sha1:5159ecd9220b505343a5744e01b61825cb734fef</id>
<content type='text'>
`compiler_builtins` uses some convenience functions like `is_nan` and
`is_sign_positive`. Add these, as well as a temporary implementation for
`Debug` that prints the bit representation.
</content>
</entry>
<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>
</feed>
