summaryrefslogtreecommitdiffstats
path: root/library/std/src/f32
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:18:32 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:18:32 +0000
commit4547b622d8d29df964fa2914213088b148c498fc (patch)
tree9fc6b25f3c3add6b745be9a2400a6e96140046e9 /library/std/src/f32
parentReleasing progress-linux version 1.66.0+dfsg1-1~progress7.99u1. (diff)
downloadrustc-4547b622d8d29df964fa2914213088b148c498fc.tar.xz
rustc-4547b622d8d29df964fa2914213088b148c498fc.zip
Merging upstream version 1.67.1+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'library/std/src/f32')
-rw-r--r--library/std/src/f32/tests.rs8
1 files changed, 8 insertions, 0 deletions
diff --git a/library/std/src/f32/tests.rs b/library/std/src/f32/tests.rs
index 4ec16c84a..6ee295de6 100644
--- a/library/std/src/f32/tests.rs
+++ b/library/std/src/f32/tests.rs
@@ -587,6 +587,11 @@ fn test_asinh() {
assert_approx_eq!((-2.0f32).asinh(), -1.443635475178810342493276740273105f32);
// regression test for the catastrophic cancellation fixed in 72486
assert_approx_eq!((-3000.0f32).asinh(), -8.699514775987968673236893537700647f32);
+
+ // test for low accuracy from issue 104548
+ assert_approx_eq!(60.0f32, 60.0f32.sinh().asinh());
+ // mul needed for approximate comparison to be meaningful
+ assert_approx_eq!(1.0f32, 1e-15f32.sinh().asinh() * 1e15f32);
}
#[test]
@@ -602,6 +607,9 @@ fn test_acosh() {
assert!(nan.acosh().is_nan());
assert_approx_eq!(2.0f32.acosh(), 1.31695789692481670862504634730796844f32);
assert_approx_eq!(3.0f32.acosh(), 1.76274717403908605046521864995958461f32);
+
+ // test for low accuracy from issue 104548
+ assert_approx_eq!(60.0f32, 60.0f32.cosh().acosh());
}
#[test]