Skip to content

Commit ecdfd07

Browse files
committed
Use reliable_f{16,128}_math
1 parent aa95fef commit ecdfd07

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed

library/std/src/f128.rs

+10
Original file line numberDiff line numberDiff line change
@@ -495,8 +495,10 @@ impl f128 {
495495
/// Non-positive values:
496496
/// ```
497497
/// #![feature(f128)]
498+
/// # #[cfg(reliable_f128_math)] {
498499
/// assert_eq!(0_f128.ln(), f128::NEG_INFINITY);
499500
/// assert!((-42_f128).ln().is_nan());
501+
/// # }
500502
/// ```
501503
#[inline]
502504
#[rustc_allow_incoherent_impl]
@@ -537,8 +539,10 @@ impl f128 {
537539
/// Non-positive values:
538540
/// ```
539541
/// #![feature(f128)]
542+
/// # #[cfg(reliable_f128_math)] {
540543
/// assert_eq!(0_f128.log(10.0), f128::NEG_INFINITY);
541544
/// assert!((-42_f128).log(10.0).is_nan());
545+
/// # }
542546
/// ```
543547
#[inline]
544548
#[rustc_allow_incoherent_impl]
@@ -575,8 +579,10 @@ impl f128 {
575579
/// Non-positive values:
576580
/// ```
577581
/// #![feature(f128)]
582+
/// # #[cfg(reliable_f128_math)] {
578583
/// assert_eq!(0_f128.log2(), f128::NEG_INFINITY);
579584
/// assert!((-42_f128).log2().is_nan());
585+
/// # }
580586
/// ```
581587
#[inline]
582588
#[rustc_allow_incoherent_impl]
@@ -613,8 +619,10 @@ impl f128 {
613619
/// Non-positive values:
614620
/// ```
615621
/// #![feature(f128)]
622+
/// # #[cfg(reliable_f128_math)] {
616623
/// assert_eq!(0_f128.log10(), f128::NEG_INFINITY);
617624
/// assert!((-42_f128).log10().is_nan());
625+
/// # }
618626
/// ```
619627
#[inline]
620628
#[rustc_allow_incoherent_impl]
@@ -1031,8 +1039,10 @@ impl f128 {
10311039
/// Out-of-range values:
10321040
/// ```
10331041
/// #![feature(f128)]
1042+
/// # #[cfg(reliable_f128_math)] {
10341043
/// assert_eq!((-1.0_f128).ln_1p(), f128::NEG_INFINITY);
10351044
/// assert!((-2.0_f128).ln_1p().is_nan());
1045+
/// # }
10361046
/// ```
10371047
#[inline]
10381048
#[doc(alias = "log1p")]

library/std/src/f16.rs

+10
Original file line numberDiff line numberDiff line change
@@ -495,8 +495,10 @@ impl f16 {
495495
/// Non-positive values:
496496
/// ```
497497
/// #![feature(f16)]
498+
/// # #[cfg(reliable_f16_math)] {
498499
/// assert_eq!(0_f16.ln(), f16::NEG_INFINITY);
499500
/// assert!((-42_f16).ln().is_nan());
501+
/// # }
500502
/// ```
501503
#[inline]
502504
#[rustc_allow_incoherent_impl]
@@ -537,8 +539,10 @@ impl f16 {
537539
/// Non-positive values:
538540
/// ```
539541
/// #![feature(f16)]
542+
/// # #[cfg(reliable_f16_math)] {
540543
/// assert_eq!(0_f16.log(10.0), f16::NEG_INFINITY);
541544
/// assert!((-42_f16).log(10.0).is_nan());
545+
/// # }
542546
/// ```
543547
#[inline]
544548
#[rustc_allow_incoherent_impl]
@@ -575,8 +579,10 @@ impl f16 {
575579
/// Non-positive values:
576580
/// ```
577581
/// #![feature(f16)]
582+
/// # #[cfg(reliable_f16_math)] {
578583
/// assert_eq!(0_f16.log2(), f16::NEG_INFINITY);
579584
/// assert!((-42_f16).log2().is_nan());
585+
/// # }
580586
/// ```
581587
#[inline]
582588
#[rustc_allow_incoherent_impl]
@@ -613,8 +619,10 @@ impl f16 {
613619
/// Non-positive values:
614620
/// ```
615621
/// #![feature(f16)]
622+
/// # #[cfg(reliable_f16_math)] {
616623
/// assert_eq!(0_f16.log10(), f16::NEG_INFINITY);
617624
/// assert!((-42_f16).log10().is_nan());
625+
/// # }
618626
/// ```
619627
#[inline]
620628
#[rustc_allow_incoherent_impl]
@@ -1029,8 +1037,10 @@ impl f16 {
10291037
/// Out-of-range values:
10301038
/// ```
10311039
/// #![feature(f16)]
1040+
/// # #[cfg(reliable_f16_math)] {
10321041
/// assert_eq!((-1.0_f16).ln_1p(), f16::NEG_INFINITY);
10331042
/// assert!((-2.0_f16).ln_1p().is_nan());
1043+
/// # }
10341044
/// ```
10351045
#[inline]
10361046
#[doc(alias = "log1p")]

0 commit comments

Comments
 (0)