@@ -337,7 +337,7 @@ impl HasAfEnum for f16 {
337337 type AbsOutType = Self ;
338338 type ArgOutType = Self ;
339339 type UnaryOutType = Self ;
340- type ComplexOutType = Complex < f16 > ;
340+ type ComplexOutType = Complex < f32 > ;
341341 type MeanOutType = Self ;
342342 type AggregateOutType = f32 ;
343343 type ProductOutType = f32 ;
@@ -678,12 +678,18 @@ impl FloatingPoint for f32 {
678678 true
679679 }
680680}
681+ impl FloatingPoint for f16 {
682+ fn is_real ( ) -> bool {
683+ true
684+ }
685+ }
681686
682687///Trait qualifier to accept real data(numbers)
683688pub trait RealFloating : HasAfEnum { }
684689
685690impl RealFloating for f64 { }
686691impl RealFloating for f32 { }
692+ impl RealFloating for f16 { }
687693
688694///Trait qualifier to accept complex data(numbers)
689695pub trait ComplexFloating : HasAfEnum { }
@@ -696,6 +702,7 @@ pub trait RealNumber: HasAfEnum {}
696702
697703impl RealNumber for f64 { }
698704impl RealNumber for f32 { }
705+ impl RealNumber for f16 { }
699706impl RealNumber for i32 { }
700707impl RealNumber for u32 { }
701708impl RealNumber for i16 { }
@@ -856,6 +863,8 @@ impl Fromf64 for u32 { fn fromf64(value: f64) -> Self { value as Self }}
856863#[ rustfmt:: skip]
857864impl Fromf64 for i32 { fn fromf64 ( value : f64 ) -> Self { value as Self } }
858865#[ rustfmt:: skip]
866+ impl Fromf64 for f16 { fn fromf64 ( value : f64 ) -> Self { f16:: from_f64 ( value) } }
867+ #[ rustfmt:: skip]
859868impl Fromf64 for u16 { fn fromf64 ( value : f64 ) -> Self { value as Self } }
860869#[ rustfmt:: skip]
861870impl Fromf64 for i16 { fn fromf64 ( value : f64 ) -> Self { value as Self } }
@@ -873,6 +882,7 @@ impl IndexableType for u64 {}
873882impl IndexableType for f32 { }
874883impl IndexableType for i32 { }
875884impl IndexableType for u32 { }
885+ impl IndexableType for f16 { }
876886impl IndexableType for i16 { }
877887impl IndexableType for u16 { }
878888impl IndexableType for u8 { }
0 commit comments