]> git.lizzy.rs Git - rust.git/commitdiff
Rollup merge of #101889 - tspiteri:redoc-uint-adc-sbb, r=m-ou-se
authorMatthias Krüger <matthias.krueger@famsik.de>
Tue, 18 Oct 2022 19:18:46 +0000 (21:18 +0200)
committerGitHub <noreply@github.com>
Tue, 18 Oct 2022 19:18:46 +0000 (21:18 +0200)
doc: rewrite doc for uint::{carrying_add,borrowing_sub}

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 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.

1  2 
library/core/src/num/uint_macros.rs

Simple merge