rust icon indicating copy to clipboard operation
rust copied to clipboard

float types: document NaN bit pattern guarantees

Open RalfJung opened this issue 1 year ago • 3 comments

Part of https://github.com/rust-lang/rust/issues/128288: document the guarantees we make for NaN bit patterns.

Cc @tgross35

RalfJung avatar Aug 25 '24 14:08 RalfJung

r? @thomcc

rustbot has assigned @thomcc. They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

rustbot avatar Aug 25 '24 14:08 rustbot

Cc @beetrees (more of a float expert than me)

tgross35 avatar Aug 25 '24 20:08 tgross35

Would it be worth also updating the docs for copysign to say something about what happens when the sign argument is a NaN (similar to the addition to is_sign_{positive,negative} docs)? Currently the the copysign docs only discuss what happens when self is a NaN. The link in the copysign docs could also be updated to point to the new NaN bit patterns section.

beetrees avatar Aug 26 '24 13:08 beetrees

Fair points, I think I took care of all of them. :)

RalfJung avatar Aug 26 '24 15:08 RalfJung

Looks fine to me. This is part of an approved RFC and is doc-only so I don't think it needs any FCP or anything.

@bors r+ rollup

thomcc avatar Aug 27 '24 01:08 thomcc

:pushpin: Commit 0c7d6c45e6b664fa4875741e78d185845d374f07 has been approved by thomcc

It is now in the queue for this repository.

bors avatar Aug 27 '24 01:08 bors