-
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: rewrite doc for uint::{carrying_add,borrowing_sub} #101889
Conversation
Hey! It looks like you've submitted a new PR for the library teams! If this PR contains changes to any Examples of
|
(rust-highfive has picked a reviewer for you, use r? to override) |
r? @m-ou-se |
If this is accepted, I can also have a go at the documentation for the signed methods. |
This comment has been minimized.
This comment has been minimized.
1d22c1d
to
f4d4088
Compare
f4d4088
to
33421da
Compare
Thanks! @bors r+ rollup |
…u-se doc: rewrite doc for uint::{carrying_add,borrowing_sub} Reword the documentation for bigint helper methods `uint::{carrying_add,borrowing_sub}` (rust-lang#85532). The examples were also rewritten to demonstrate how the methods can be used in bignum arithmetic. No loops are used in the examples, but the variable names were chosen to include indices so that it is clear how this can be used in a loop if required. Also, previously `carrying_add` had an example to say that if the input carry is false, the method is equivalent to `overflowing_add`. While the note was kept, the example was removed and an extra note was added to make sure this equivalence is not assumed for signed integers as well.
…iaskrgr Rollup of 6 pull requests Successful merges: - rust-lang#101889 (doc: rewrite doc for uint::{carrying_add,borrowing_sub}) - rust-lang#102507 (More slice::partition_point examples) - rust-lang#103164 (rustdoc: remove CSS ``@media` (min-width: 701px)`) - rust-lang#103189 (Clean up code-color and headers-color rustdoc GUI tests) - rust-lang#103203 (Retrieve LLVM version from llvm-filecheck binary if it is not set yet) - rust-lang#103204 (Add some more autolabels) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
doc: rewrite doc for signed int::{carrying_add,borrowing_sub} Reword the documentation for bigint helper methods, signed `int::{carrying_add,borrowing_sub}` (rust-lang#85532). This change is a follow-up to rust-lang#101889, which was for the unsigned methods.
doc: rewrite doc for signed int::{carrying_add,borrowing_sub} Reword the documentation for bigint helper methods, signed `int::{carrying_add,borrowing_sub}` (rust-lang#85532). This change is a follow-up to rust-lang#101889, which was for the unsigned methods.
Reword the documentation for bigint helper methods
uint::{carrying_add,borrowing_sub}
(#85532).The examples were also rewritten to demonstrate how the methods can be used in bignum arithmetic. No loops are used in the examples, but the variable names were chosen to include indices so that it is clear how this can be used in a loop if required.
Also, previously
carrying_add
had an example to say that if the input carry is false, the method is equivalent tooverflowing_add
. While the note was kept, the example was removed and an extra note was added to make sure this equivalence is not assumed for signed integers as well.