-
Notifications
You must be signed in to change notification settings - Fork 12.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
doc: show that f32::log
and f64::log
are not correctly rounded
#47277
Conversation
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @aidanhs (or someone else) soon. If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes. Please see the contribution instructions for more information. |
FWIW I'm not a big fan of putting the implementation in the docs. |
I'm inclined to agree. What about removing the implementation details and saying something like
? |
I've removed the implementation details from the doc. (BTW, rust-highfive suggests extra commits for changes, which is what I did; if I should squash the commits into one please let me know.) |
Adding new commits can be useful for big changes, but for small things like this I personally don't see the need. In any case, we prefer to squash before merging. |
This seems good to me but I'd like to get a docs team member to take a look - r? @frewsxcv |
looks good to me, thanks! @bors r+ rollup |
📌 Commit 6d82e78 has been approved by |
doc: show that `f32::log` and `f64::log` are not correctly rounded Fixes rust-lang#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.
doc: show that `f32::log` and `f64::log` are not correctly rounded Fixes rust-lang#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.
☔ The latest upstream changes (presumably #47445) made this pull request unmergeable. Please resolve the merge conflicts. |
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 thelog
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 themul_add
method.