Skip to content

Commit 00c3b6d

Browse files
Use -0.0 as the neutral additive float
-0.0 + 0.0 is 0.0 -0.0 + -0.0 is -0.0 Thus, the float additive-zero is actually -0.0, not its positive cousin. This change aligns with a recent change to the impl of Sum for floats, in 4908188 and accordingly we also have to use the latest toolchain for our tests now.
1 parent 5fb43ca commit 00c3b6d

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

crates/core_simd/src/simd/num/float.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -419,7 +419,7 @@ macro_rules! impl_trait {
419419
self.as_array().iter().sum()
420420
} else {
421421
// Safety: `self` is a float vector
422-
unsafe { core::intrinsics::simd::simd_reduce_add_ordered(self, 0.) }
422+
unsafe { core::intrinsics::simd::simd_reduce_add_ordered(self, -0.) }
423423
}
424424
}
425425

rust-toolchain.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
[toolchain]
2-
channel = "nightly-2024-06-13"
2+
channel = "nightly-2024-09-11"
33
components = ["rustfmt", "clippy", "miri", "rust-src"]

0 commit comments

Comments
 (0)