Uh oh!
There was an error while loading. Please reload this page.
Re-implement float min/max in rust - #42430
Conversation
rust-highfive
commented
Jun 4, 2017
r? @aturon (rust_highfive has picked a reviewer for you, use r? to override) |
There was a problem hiding this comment.
self < other so self is that minimal one, seems reasonable.
There was a problem hiding this comment.
The other one is/was wrong. I’ll just write down some tests.
7544f5c to
540373dComparenatboehm
commented
Jun 5, 2017
Tidy is failing because this isn't mentioned in the book. |
333bf76 to
ef2b445Comparecarols10cents
commented
Jun 12, 2017
Aturon's on vacation this week, so let's try... |
There was a problem hiding this comment.
Since these are stable in the standard library I think it's fine to go ahead and stabilize them in libcore itself, this is just moving the implementation down a layer where we could
There was a problem hiding this comment.
FWIW the musl implementation is quite different, it's not clear to me that these are the same?
There was a problem hiding this comment.
The only difference between the implementations is handling of the signed zero. IEEE 754 allows to ignore the signed-ness of zero here and, if 0.0 is compared to -0.0, to return either one.
Even the C99 standard does not mention signed zeroes in the annex referenced by musl. It quite literally paraphrases the IEEE 754 and provides an example implementation which matches (with small differences) the one provided here.
bd0be22 to
b1dadc8Comparealexcrichton
commented
Jun 16, 2017
@bors: r+ |
bors
commented
Jun 16, 2017
📌 Commit ba6cf1d has been approved by |
bors
commented
Jun 16, 2017
Re-implement float min/max in rust This also adds the relevant implementations into libcore. See #42423
bors
commented
Jun 16, 2017
☀️ Test successful - status-appveyor, status-travis |
This also adds the relevant implementations into libcore.
See #42423