]> git.lizzy.rs Git - rust.git/commitdiff
Take 2^5 as examples in document of pow() (fixes #48396)
authorHidehito Yabuuchi <hdht.ybuc@gmail.com>
Wed, 21 Feb 2018 13:30:40 +0000 (22:30 +0900)
committerHidehito Yabuuchi <hdht.ybuc@gmail.com>
Wed, 21 Feb 2018 13:34:45 +0000 (22:34 +0900)
Current document takes 2^4, which is equal to 4^2.
This example is not very helpful for those unfamiliar with math words in English and thus rely on example codes.

src/libcore/num/mod.rs

index 560dcf295b278154ad0b71b4ea8be21cf2a0319e..43330b63f9b9c4e9338bad4ac098a3c9e18a07ea 100644 (file)
@@ -1209,7 +1209,7 @@ pub fn overflowing_abs(self) -> (Self, bool) {
 ```
 ", $Feature, "let x: ", stringify!($SelfT), " = 2; // or any other integer type
 
-assert_eq!(x.pow(4), 16);",
+assert_eq!(x.pow(5), 32);",
 $EndFeature, "
 ```"),
             #[stable(feature = "rust1", since = "1.0.0")]
@@ -2364,7 +2364,7 @@ pub fn overflowing_shr(self, rhs: u32) -> (Self, bool) {
 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")]
         #[inline]