From 6b8cb42ee3dd9cfd60e174cb9d0500d7b0516e45 Mon Sep 17 00:00:00 2001 From: Nivekithan Date: Mon, 20 Apr 2026 18:55:05 +0530 Subject: [PATCH] update doc to be more clear --- library/core/src/num/int_macros.rs | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/library/core/src/num/int_macros.rs b/library/core/src/num/int_macros.rs index d68a9493e9f3..33aa2ab14dce 100644 --- a/library/core/src/num/int_macros.rs +++ b/library/core/src/num/int_macros.rs @@ -1911,7 +1911,11 @@ pub const fn strict_pow(self, mut exp: u32) -> Self { } } - /// Returns the square root of the number, rounded down. + /// Returns the integer square root of the number, rounded down. + /// + /// This function returns the **principal (non-negative) square root**. + /// For a given number `n`, although both `x` and `-x` satisfy x2 = n, + /// this function always returns the non-negative value. /// /// Returns `None` if `self` is negative. /// @@ -3206,7 +3210,11 @@ pub const fn pow(self, mut exp: u32) -> Self { } } - /// Returns the square root of the number, rounded down. + /// Returns the integer square root of the number, rounded down. + /// + /// This function returns the **principal (non-negative) square root**. + /// For a given number `n`, although both `x` and `-x` satisfy x2 = n, + /// this function always returns the non-negative value. /// /// # Panics ///