cleanup 'newtons_method'
This commit is contained in:
parent
844843531a
commit
c02dc63674
@ -151,10 +151,15 @@ pub fn newtons_method(
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// if `ele.y` is NaN, just continue iterating
|
||||||
|
if ele.y.is_nan() {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
let last_ele_y = last_ele_option.unwrap().y; // store this here as it's used multiple times
|
let last_ele_y = last_ele_option.unwrap().y; // store this here as it's used multiple times
|
||||||
|
|
||||||
// If either are NaN, just continue iterating
|
// if `last_ele.y` is NaN, continue iterating
|
||||||
if last_ele_y.is_nan() | ele.y.is_nan() {
|
if last_ele_y.is_nan() {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user