未验证 提交 24c17cb1 编写于 作者: G Guillaume Gomez 提交者: GitHub

Rollup merge of #48397 - ordovicia:pow_doc, r=GuillaumeGomez

Take 2^5 as examples in document of pow()

Fixes #48396 by taking 2^5 as examples.
...@@ -1209,7 +1209,7 @@ pub fn overflowing_abs(self) -> (Self, bool) { ...@@ -1209,7 +1209,7 @@ pub fn overflowing_abs(self) -> (Self, bool) {
``` ```
", $Feature, "let x: ", stringify!($SelfT), " = 2; // or any other integer type ", $Feature, "let x: ", stringify!($SelfT), " = 2; // or any other integer type
assert_eq!(x.pow(4), 16);", assert_eq!(x.pow(5), 32);",
$EndFeature, " $EndFeature, "
```"), ```"),
#[stable(feature = "rust1", since = "1.0.0")] #[stable(feature = "rust1", since = "1.0.0")]
...@@ -2364,7 +2364,7 @@ pub fn overflowing_shr(self, rhs: u32) -> (Self, bool) { ...@@ -2364,7 +2364,7 @@ pub fn overflowing_shr(self, rhs: u32) -> (Self, bool) {
Basic usage: Basic usage:
``` ```
", $Feature, "assert_eq!(2", stringify!($SelfT), ".pow(4), 16);", $EndFeature, " ", $Feature, "assert_eq!(2", stringify!($SelfT), ".pow(5), 32);", $EndFeature, "
```"), ```"),
#[stable(feature = "rust1", since = "1.0.0")] #[stable(feature = "rust1", since = "1.0.0")]
#[inline] #[inline]
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册