MCPcopy Create free account
hub / github.com/LibertyOS-Development/kernel / IntSqRoot

Interface IntSqRoot

src/math/int/sr.rs:5–19  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3// This is a simple library to calculate square-roots from integers.
4
5pub trait IntSqRoot
6{
7 fn intsqroot(&self) -> Self
8 where
9 Self: Sized,
10 {
11 self.intsqroot_check()
12 .expect("[ERR] CANNOT CALCULATE THE SQUARE ROOT OF A NEGATIVE INTEGER")
13 }
14
15 // Calculate the square root, or return "None" in the event of the integer being negative.
16 fn intsqroot_check(&self) -> Option<Self>
17 where
18 Self: Sized;
19}
20
21
22impl<T: num_traits::PrimInt> IntSqRoot for T

Callers

nothing calls this directly

Implementers 1

sr.rssrc/math/int/sr.rs

Calls

no outgoing calls

Tested by

no test coverage detected