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 3739372 commit fa50056Copy full SHA for fa50056
stdlib/src/math.rs
@@ -331,7 +331,7 @@ mod math {
331
};
332
let mut norm = v
333
.iter()
334
- .cloned()
+ .copied()
335
.map(|x| x / scale)
336
.reduce(accurate_hypot)
337
.unwrap_or_default();
@@ -342,9 +342,8 @@ mod math {
342
// approximation of the square root of that to `norm`.
343
let correction = v
344
345
346
- .map(|x| x / scale)
347
- .map(|x| x * x)
+ .map(|x| (x / scale).pow(2))
348
.chain(std::iter::once(-norm * norm))
349
.tree_fold1(std::ops::Add::add)
350
.unwrap();
0 commit comments