]> git.lizzy.rs Git - rust.git/commit
Rollup merge of #47277 - tspiteri:log-correctness, r=frewsxcv
authorkennytm <kennytm@gmail.com>
Mon, 15 Jan 2018 08:55:29 +0000 (16:55 +0800)
committerkennytm <kennytm@gmail.com>
Mon, 15 Jan 2018 10:49:32 +0000 (18:49 +0800)
commit26c1ec300c233caf71e5ff35b52b149e5c98810f
tree8151e437d55b69e6de4b263d24350eed1c9eba57
parent5d0474ad73f2d9268f387726723fff44b88df3f7
parent6d82e7814f1a387c0510ee525c6e0ac8fa890c40
Rollup merge of #47277 - tspiteri:log-correctness, r=frewsxcv

doc: show that `f32::log` and `f64::log` are not correctly rounded

Fixes #47273.

One thing I'm not sure about is whether the "calculated as `self.ln() / base.ln()`" bit is being too specific, maybe we do not want to make this such a strong commitment. I think it's fine, but we should not make commitments in the API documentation by accident.

In case that is removed, the added sentence "`self.log2()` can ... base 10." still makes it amply clear that the `log` methods can be more inaccurate than other methods. If the above clause is removed, this second sentence can be moved to the first paragraph, kind of like the accuracy comment for the [`mul_add`](https://doc.rust-lang.org/std/primitive.f32.html#method.mul_add) method.