@@ -27,7 +27,7 @@ pub use num_traits::float::FloatCore;
27
27
use num_traits:: {
28
28
AsPrimitive , Bounded , FloatConst , FromPrimitive , Num , NumCast , One , Signed , ToPrimitive , Zero ,
29
29
} ;
30
- #[ cfg( feature = "std" ) ]
30
+ #[ cfg( any ( feature = "std" , feature = "libm" ) ) ]
31
31
pub use num_traits:: { Float , Pow } ;
32
32
33
33
#[ cfg( feature = "rand" ) ]
@@ -571,7 +571,7 @@ impl_ordered_float_binop! {Rem, rem, RemAssign, rem_assign}
571
571
572
572
macro_rules! impl_ordered_float_pow {
573
573
( $inner: ty, $rhs: ty) => {
574
- #[ cfg( feature = "std" ) ]
574
+ #[ cfg( any ( feature = "std" , feature = "libm" ) ) ]
575
575
impl Pow <$rhs> for OrderedFloat <$inner> {
576
576
type Output = OrderedFloat <$inner>;
577
577
#[ inline]
@@ -580,7 +580,7 @@ macro_rules! impl_ordered_float_pow {
580
580
}
581
581
}
582
582
583
- #[ cfg( feature = "std" ) ]
583
+ #[ cfg( any ( feature = "std" , feature = "libm" ) ) ]
584
584
impl <' a> Pow <& ' a $rhs> for OrderedFloat <$inner> {
585
585
type Output = OrderedFloat <$inner>;
586
586
#[ inline]
@@ -589,7 +589,7 @@ macro_rules! impl_ordered_float_pow {
589
589
}
590
590
}
591
591
592
- #[ cfg( feature = "std" ) ]
592
+ #[ cfg( any ( feature = "std" , feature = "libm" ) ) ]
593
593
impl <' a> Pow <$rhs> for & ' a OrderedFloat <$inner> {
594
594
type Output = OrderedFloat <$inner>;
595
595
#[ inline]
@@ -598,7 +598,7 @@ macro_rules! impl_ordered_float_pow {
598
598
}
599
599
}
600
600
601
- #[ cfg( feature = "std" ) ]
601
+ #[ cfg( any ( feature = "std" , feature = "libm" ) ) ]
602
602
impl <' a, ' b> Pow <& ' a $rhs> for & ' b OrderedFloat <$inner> {
603
603
type Output = OrderedFloat <$inner>;
604
604
#[ inline]
@@ -625,7 +625,7 @@ impl_ordered_float_pow! {f64, f64}
625
625
626
626
macro_rules! impl_ordered_float_self_pow {
627
627
( $base: ty, $exp: ty) => {
628
- #[ cfg( feature = "std" ) ]
628
+ #[ cfg( any ( feature = "std" , feature = "libm" ) ) ]
629
629
impl Pow <OrderedFloat <$exp>> for OrderedFloat <$base> {
630
630
type Output = OrderedFloat <$base>;
631
631
#[ inline]
@@ -634,7 +634,7 @@ macro_rules! impl_ordered_float_self_pow {
634
634
}
635
635
}
636
636
637
- #[ cfg( feature = "std" ) ]
637
+ #[ cfg( any ( feature = "std" , feature = "libm" ) ) ]
638
638
impl <' a> Pow <& ' a OrderedFloat <$exp>> for OrderedFloat <$base> {
639
639
type Output = OrderedFloat <$base>;
640
640
#[ inline]
@@ -643,7 +643,7 @@ macro_rules! impl_ordered_float_self_pow {
643
643
}
644
644
}
645
645
646
- #[ cfg( feature = "std" ) ]
646
+ #[ cfg( any ( feature = "std" , feature = "libm" ) ) ]
647
647
impl <' a> Pow <OrderedFloat <$exp>> for & ' a OrderedFloat <$base> {
648
648
type Output = OrderedFloat <$base>;
649
649
#[ inline]
@@ -652,7 +652,7 @@ macro_rules! impl_ordered_float_self_pow {
652
652
}
653
653
}
654
654
655
- #[ cfg( feature = "std" ) ]
655
+ #[ cfg( any ( feature = "std" , feature = "libm" ) ) ]
656
656
impl <' a, ' b> Pow <& ' a OrderedFloat <$exp>> for & ' b OrderedFloat <$base> {
657
657
type Output = OrderedFloat <$base>;
658
658
#[ inline]
@@ -1037,7 +1037,7 @@ impl<T: FloatCore> FloatCore for OrderedFloat<T> {
1037
1037
}
1038
1038
}
1039
1039
1040
- #[ cfg( feature = "std" ) ]
1040
+ #[ cfg( any ( feature = "std" , feature = "libm" ) ) ]
1041
1041
impl < T : Float + FloatCore > Float for OrderedFloat < T > {
1042
1042
fn nan ( ) -> Self {
1043
1043
OrderedFloat ( <T as Float >:: nan ( ) )
@@ -1663,7 +1663,7 @@ impl_not_nan_binop! {Rem, rem, RemAssign, rem_assign}
1663
1663
// Will panic if NaN value is return from the operation
1664
1664
macro_rules! impl_not_nan_pow {
1665
1665
( $inner: ty, $rhs: ty) => {
1666
- #[ cfg( feature = "std" ) ]
1666
+ #[ cfg( any ( feature = "std" , feature = "libm" ) ) ]
1667
1667
impl Pow <$rhs> for NotNan <$inner> {
1668
1668
type Output = NotNan <$inner>;
1669
1669
#[ inline]
@@ -1672,7 +1672,7 @@ macro_rules! impl_not_nan_pow {
1672
1672
}
1673
1673
}
1674
1674
1675
- #[ cfg( feature = "std" ) ]
1675
+ #[ cfg( any ( feature = "std" , feature = "libm" ) ) ]
1676
1676
impl <' a> Pow <& ' a $rhs> for NotNan <$inner> {
1677
1677
type Output = NotNan <$inner>;
1678
1678
#[ inline]
@@ -1681,7 +1681,7 @@ macro_rules! impl_not_nan_pow {
1681
1681
}
1682
1682
}
1683
1683
1684
- #[ cfg( feature = "std" ) ]
1684
+ #[ cfg( any ( feature = "std" , feature = "libm" ) ) ]
1685
1685
impl <' a> Pow <$rhs> for & ' a NotNan <$inner> {
1686
1686
type Output = NotNan <$inner>;
1687
1687
#[ inline]
@@ -1690,7 +1690,7 @@ macro_rules! impl_not_nan_pow {
1690
1690
}
1691
1691
}
1692
1692
1693
- #[ cfg( feature = "std" ) ]
1693
+ #[ cfg( any ( feature = "std" , feature = "libm" ) ) ]
1694
1694
impl <' a, ' b> Pow <& ' a $rhs> for & ' b NotNan <$inner> {
1695
1695
type Output = NotNan <$inner>;
1696
1696
#[ inline]
@@ -1718,7 +1718,7 @@ impl_not_nan_pow! {f64, f64}
1718
1718
// This also should panic on NaN
1719
1719
macro_rules! impl_not_nan_self_pow {
1720
1720
( $base: ty, $exp: ty) => {
1721
- #[ cfg( feature = "std" ) ]
1721
+ #[ cfg( any ( feature = "std" , feature = "libm" ) ) ]
1722
1722
impl Pow <NotNan <$exp>> for NotNan <$base> {
1723
1723
type Output = NotNan <$base>;
1724
1724
#[ inline]
@@ -1727,7 +1727,7 @@ macro_rules! impl_not_nan_self_pow {
1727
1727
}
1728
1728
}
1729
1729
1730
- #[ cfg( feature = "std" ) ]
1730
+ #[ cfg( any ( feature = "std" , feature = "libm" ) ) ]
1731
1731
impl <' a> Pow <& ' a NotNan <$exp>> for NotNan <$base> {
1732
1732
type Output = NotNan <$base>;
1733
1733
#[ inline]
@@ -1736,7 +1736,7 @@ macro_rules! impl_not_nan_self_pow {
1736
1736
}
1737
1737
}
1738
1738
1739
- #[ cfg( feature = "std" ) ]
1739
+ #[ cfg( any ( feature = "std" , feature = "libm" ) ) ]
1740
1740
impl <' a> Pow <NotNan <$exp>> for & ' a NotNan <$base> {
1741
1741
type Output = NotNan <$base>;
1742
1742
#[ inline]
@@ -1745,7 +1745,7 @@ macro_rules! impl_not_nan_self_pow {
1745
1745
}
1746
1746
}
1747
1747
1748
- #[ cfg( feature = "std" ) ]
1748
+ #[ cfg( any ( feature = "std" , feature = "libm" ) ) ]
1749
1749
impl <' a, ' b> Pow <& ' a NotNan <$exp>> for & ' b NotNan <$base> {
1750
1750
type Output = NotNan <$base>;
1751
1751
#[ inline]
0 commit comments