File: x87-01-force-test-eval-runtime.patch

package info (click to toggle)
rust-libm 0.2.1-5
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 1,164 kB
  • sloc: sh: 36; makefile: 2
file content (43 lines) | stat: -rw-r--r-- 1,374 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
commit 5672d6722919a6bdd9fbb386eec667fb091f4cbc
Author: Peter Michael Green <plugwash@debian.org>
Date:   Wed Dec 22 00:56:18 2021 +0000

    force test_near_pi in rem_pio2.rs to be evaluated at runtime not compiletime.

diff --git a/src/math/rem_pio2.rs b/src/math/rem_pio2.rs
index 46f7c38..f58fa35 100644
--- a/src/math/rem_pio2.rs
+++ b/src/math/rem_pio2.rs
@@ -190,20 +190,28 @@ mod tests {
 
     #[test]
     fn test_near_pi() {
+        let arg = 3.141592025756836;
+        force_eval!(arg);
         assert_eq!(
-            rem_pio2(3.141592025756836),
+            rem_pio2(arg),
             (2, -6.278329573009626e-7, -2.1125998133974653e-23)
         );
+        let arg = 3.141592033207416;
+        force_eval!(arg);
         assert_eq!(
-            rem_pio2(3.141592033207416),
+            rem_pio2(arg),
             (2, -6.20382377148128e-7, -2.1125998133974653e-23)
         );
+        let arg = 3.141592144966125;
+        force_eval!(arg);
         assert_eq!(
-            rem_pio2(3.141592144966125),
+            rem_pio2(arg),
             (2, -5.086236681942706e-7, -2.1125998133974653e-23)
         );
+        let arg = 3.141592979431152;
+        force_eval!(arg);
         assert_eq!(
-            rem_pio2(3.141592979431152),
+            rem_pio2(arg),
             (2, 3.2584135866119817e-7, -2.1125998133974653e-23)
         );
     }