We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 60fb612 commit 927ebafCopy full SHA for 927ebaf
src/uint/sqrt.rs
@@ -102,7 +102,7 @@ impl<const LIMBS: usize> Uint<LIMBS> {
102
103
#[cfg(test)]
104
mod tests {
105
- use crate::{Limb, U256};
+ use crate::{Limb, U192, U256};
106
107
#[cfg(feature = "rand")]
108
use {
@@ -120,6 +120,17 @@ mod tests {
120
half.limbs[i] = Limb::MAX;
121
}
122
assert_eq!(U256::MAX.sqrt(), half);
123
+
124
+ assert_eq!(
125
+ U192::from_be_hex("055fa39422bd9f281762946e056535badbf8a6864d45fa3d").sqrt(),
126
+ U192::from_be_hex("0000000000000000000000002516f0832a538b2d98869e21")
127
+ );
128
129
130
+ U256::from_be_hex("4bb750738e25a8f82940737d94a48a91f8cd918a3679ff90c1a631f2bd6c3597")
131
+ .sqrt(),
132
+ U256::from_be_hex("000000000000000000000000000000008b3956339e8315cff66eb6107b610075")
133
134
135
136
#[test]
0 commit comments