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 91b818c commit 0c3f2efCopy full SHA for 0c3f2ef
src/lib.rs
@@ -213,13 +213,11 @@ impl<T: Float> Complex<T> {
213
if !im.is_finite() {
214
return Self::new(T::zero(), T::zero());
215
}
216
- } else {
217
- if im == T::zero() || !im.is_finite() {
218
- if im.is_infinite() {
219
- im = T::nan();
220
- }
221
- return Self::new(re, im);
+ } else if im == T::zero() || !im.is_finite() {
+ if im.is_infinite() {
+ im = T::nan();
222
+ return Self::new(re, im);
223
224
} else if re.is_nan() && im == T::zero() {
225
return self;
0 commit comments