Skip to content

Commit

Permalink
Core Lib Documentation: Sqrt module (#6804)
Browse files Browse the repository at this point in the history
Co-authored-by: enitrat <[email protected]>
  • Loading branch information
TAdev0 and enitrat authored Dec 2, 2024
1 parent 8fedd90 commit 656596f
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion corelib/src/num/traits/ops/sqrt.cairo
Original file line number Diff line number Diff line change
@@ -1,8 +1,18 @@
//! Square root operation for unsigned numeric types.

/// A trait for computing the square root of a number.
///
/// # Examples
///
/// ```
/// use core::num::traits::Sqrt;
///
/// assert!(9_u8.sqrt() == 3);
/// ```
pub trait Sqrt<T> {
/// The type of the result of the square root operation.
type Target;
/// Compute the square root of a number.
/// Computes the square root of a number.
fn sqrt(self: T) -> Self::Target;
}

Expand Down

0 comments on commit 656596f

Please sign in to comment.