@@ -341,7 +341,7 @@ impl HasAfEnum for f16 {
341341 type AbsOutType = Self ;
342342 type ArgOutType = Self ;
343343 type UnaryOutType = Self ;
344- type ComplexOutType = Complex < f16 > ;
344+ type ComplexOutType = Complex < f32 > ;
345345 type MeanOutType = Self ;
346346 type AggregateOutType = f32 ;
347347 type ProductOutType = f32 ;
@@ -682,12 +682,18 @@ impl FloatingPoint for f32 {
682682 true
683683 }
684684}
685+ impl FloatingPoint for f16 {
686+ fn is_real ( ) -> bool {
687+ true
688+ }
689+ }
685690
686691///Trait qualifier to accept real data(numbers)
687692pub trait RealFloating : HasAfEnum { }
688693
689694impl RealFloating for f64 { }
690695impl RealFloating for f32 { }
696+ impl RealFloating for f16 { }
691697
692698///Trait qualifier to accept complex data(numbers)
693699pub trait ComplexFloating : HasAfEnum { }
@@ -700,6 +706,7 @@ pub trait RealNumber: HasAfEnum {}
700706
701707impl RealNumber for f64 { }
702708impl RealNumber for f32 { }
709+ impl RealNumber for f16 { }
703710impl RealNumber for i32 { }
704711impl RealNumber for u32 { }
705712impl RealNumber for i16 { }
@@ -860,6 +867,8 @@ impl Fromf64 for u32 { fn fromf64(value: f64) -> Self { value as Self }}
860867#[ rustfmt:: skip]
861868impl Fromf64 for i32 { fn fromf64 ( value : f64 ) -> Self { value as Self } }
862869#[ rustfmt:: skip]
870+ impl Fromf64 for f16 { fn fromf64 ( value : f64 ) -> Self { f16:: from_f64 ( value) } }
871+ #[ rustfmt:: skip]
863872impl Fromf64 for u16 { fn fromf64 ( value : f64 ) -> Self { value as Self } }
864873#[ rustfmt:: skip]
865874impl Fromf64 for i16 { fn fromf64 ( value : f64 ) -> Self { value as Self } }
@@ -877,6 +886,7 @@ impl IndexableType for u64 {}
877886impl IndexableType for f32 { }
878887impl IndexableType for i32 { }
879888impl IndexableType for u32 { }
889+ impl IndexableType for f16 { }
880890impl IndexableType for i16 { }
881891impl IndexableType for u16 { }
882892impl IndexableType for u8 { }
0 commit comments