Skip to content

Commit 55f1f45

Browse files
address review
1 parent af8f7c3 commit 55f1f45

File tree

2 files changed

+2
-6
lines changed

2 files changed

+2
-6
lines changed

src/tools/miri/src/math.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -217,8 +217,6 @@ where
217217

218218
// atan2(x, ±0) = −π/2 for x < 0.
219219
// atan2(x, ±0) = π/2 for x > 0.
220-
// REVIEW: Above is from C23, do we simplify this to the following?
221-
// atan2(±x, 0) = ±π/2 if x is non-zero
222220
("atan2f" | "atan2", [x, y]) if !x.is_zero() && y.is_zero() => pi_over_2.copy_sign(*x),
223221

224222
//atan2(±∞, −∞) = ±3π/4
@@ -286,7 +284,7 @@ where
286284
}
287285

288286
/// Returns `Some(output)` if `scalbn` (called `ldexp` in C) results in a fixed value specified in the
289-
/// C standard (specifically, C23 annex F.10.3.19) when doing `arg`*(2^`exp`). Otherwise, returns `None`.
287+
/// C standard (specifically, C23 annex F.10.3.19) when doing `arg*(2^exp)`. Otherwise, returns `None`.
290288
pub(crate) fn fixed_scalbn_value<S: Semantics>(
291289
arg: IeeeFloat<S>,
292290
exp: i32,
@@ -399,7 +397,6 @@ pub trait IeeeExt: rustc_apfloat::Float {
399397
Self::from_u128(3).value
400398
}
401399

402-
/// Equal PI.
403400
fn pi() -> Self;
404401

405402
#[inline]
@@ -413,6 +410,7 @@ macro_rules! impl_ieee_pi {
413410
impl IeeeExt for IeeeFloat<$semantic> {
414411
#[inline]
415412
fn pi() -> Self {
413+
// We take the value from the standard library as the most reasonable source for an exact π here.
416414
Self::from_bits($float_ty::consts::PI.to_bits() as _)
417415
}
418416
}

src/tools/miri/tests/pass/float.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1481,7 +1481,6 @@ fn test_non_determinism() {
14811481
}
14821482
pub fn test_operations_f32(a: f32, b: f32) {
14831483
test_operations_f!(a, b);
1484-
// FIXME: some are temporarily disabled as it breaks std tests.
14851484
ensure_nondet(|| a.powf(b));
14861485
ensure_nondet(|| a.powi(2));
14871486
ensure_nondet(|| a.log(b));
@@ -1518,7 +1517,6 @@ fn test_non_determinism() {
15181517
}
15191518
pub fn test_operations_f64(a: f64, b: f64) {
15201519
test_operations_f!(a, b);
1521-
// FIXME: some are temporarily disabled as it breaks std tests.
15221520
ensure_nondet(|| a.powf(b));
15231521
ensure_nondet(|| a.powi(2));
15241522
ensure_nondet(|| a.log(b));

0 commit comments

Comments
 (0)