try_sqrt >= 0

This commit is contained in:
Renar Narubin
2021-11-30 21:16:24 -08:00
parent 29e232f7cf
commit 91ecec3130

View File

@@ -346,8 +346,8 @@ macro_rules! impl_nalgebra {
#[inline] #[inline]
fn try_sqrt(self) -> Option<Self> { fn try_sqrt(self) -> Option<Self> {
let x = self.freeze_raw(); let x = self.freeze_raw();
if x > 0.0 { if x >= 0.0 {
Some(<$fast_ty>::new(x.sqrt())) Some(<$fast_ty>::new(x).sqrt())
} else { } else {
None None
} }