]> git.lizzy.rs Git - rust.git/commit - src/tools/miri
Rollup merge of #88523 - kpreid:category, r=yaahc
authorManish Goregaokar <manishsmail@gmail.com>
Wed, 6 Oct 2021 19:33:14 +0000 (12:33 -0700)
committerGitHub <noreply@github.com>
Wed, 6 Oct 2021 19:33:14 +0000 (12:33 -0700)
commit1e3b5d6725a84b2060f66e61a59f33ad12aa17f8
tree29c33208daf1ff7aa2eaeabfdbc990841a04a52c
parent3209582a87f7b8e098bac67f66ed58d8d5840dee
parent18df8d6e559174700e302369c2fe0d9c7c143e66
Rollup merge of #88523 - kpreid:category, r=yaahc

Expand documentation for `FpCategory`.

I intend these changes to be helpful to readers who are not yet familiar with the quirks of floating-point numbers. Additionally, I felt it was misleading to describe `Nan` as being the result of division by zero, since most divisions by zero (except for 0/0) produce `Infinite` floats, so I moved that remark to the `Infinite` variant with adjustment.

The first sentence of the `Nan` documentation is copied from `f32`; I followed the example of the `f64` documentation by referring to `f32` for general concepts, rather than duplicating the text.

----

I considered making similar changes to the documentation of the `is_*` methods of floats, but decided that that was a much larger and trickier problem; here, each of the variants' descriptions can be expected to be read in context of being mutually exclusive with the others.
library/core/src/num/mod.rs