[PATCH] core library: Disable fpmath tests for i386 ...
authorliushuyu <liushuyu011@gmail.com>
Tue, 25 Jul 2023 01:48:12 +0000 (09:48 +0800)
committerFabian Grünbichler <debian@fabian.gruenbichler.email>
Wed, 20 Sep 2023 18:18:40 +0000 (19:18 +0100)
This patch disables the floating-point epsilon test for i386 since
x87 registers are too imprecise and can't produce the expected
results.

Forwarded: https://github.com/rust-lang/rust/pull/114042

Gbp-Pq: Name u-disable-fp-precision-test-on-i386.patch

library/core/src/num/f32.rs

index 1c6819b547d27ae80b2e3144072fc1beee80423c..8e494f88c926017c992f181652d1fda6e3b495ea 100644 (file)
@@ -799,7 +799,7 @@ impl f32 {
     /// let angle = std::f32::consts::PI;
     ///
     /// let abs_difference = (angle.to_degrees() - 180.0).abs();
-    ///
+    /// # #[cfg(not(target_arch = "x86"))]
     /// assert!(abs_difference <= f32::EPSILON);
     /// ```
     #[must_use = "this returns the result of the operation, \