@@ -99,8 +99,10 @@ impl<'f> Not for &'f Array {
9999 fn not ( self ) -> Array {
100100 unsafe {
101101 let mut temp: i64 = 0 ;
102- af_not ( & mut temp as MutAfArray , self . get ( ) as AfArray ) ;
103- Array :: from ( temp)
102+ match af_not ( & mut temp as MutAfArray , self . get ( ) as AfArray ) {
103+ 0 => Array :: from ( temp) ,
104+ _ => panic ! ( "Negation of Array failed, please check input" ) ,
105+ }
104106 }
105107 }
106108}
@@ -184,6 +186,12 @@ binary_func!(add, af_add);
184186binary_func ! ( sub, af_sub) ;
185187binary_func ! ( mul, af_mul) ;
186188binary_func ! ( div, af_div) ;
189+ binary_func ! ( rem, af_rem) ;
190+ binary_func ! ( bitand, af_bitand) ;
191+ binary_func ! ( bitor, af_bitor) ;
192+ binary_func ! ( bitxor, af_bitxor) ;
193+ binary_func ! ( shiftl, af_bitshiftl) ;
194+ binary_func ! ( shiftr, af_bitshiftr) ;
187195binary_func ! ( lt, af_lt) ;
188196binary_func ! ( gt, af_gt) ;
189197binary_func ! ( le, af_le) ;
@@ -213,7 +221,7 @@ macro_rules! arith_scalar_func {
213221 match $ffi_fn( & mut temp as MutAfArray , self . get( ) as AfArray ,
214222 cnst_arr. get( ) as AfArray , 0 ) {
215223 0 => Array :: from( temp) ,
216- _ => panic!( "Arithmetic operator on Array failed with error code " ) ,
224+ _ => panic!( "Arithmetic operator on Array failed" ) ,
217225 }
218226 }
219227 }
@@ -248,10 +256,12 @@ macro_rules! arith_func {
248256 fn $fn_name( self , rhs: & ' f Array ) -> Array {
249257 unsafe {
250258 let mut temp: i64 = 0 ;
251- $ffi_fn( & mut temp as MutAfArray ,
252- self . get( ) as AfArray , rhs. get( ) as AfArray ,
253- 0 ) ;
254- Array :: from( temp)
259+ match $ffi_fn( & mut temp as MutAfArray ,
260+ self . get( ) as AfArray , rhs. get( ) as AfArray ,
261+ 0 ) {
262+ 0 => Array :: from( temp) ,
263+ _ => panic!( "Failed to perform arithmetic operation" ) ,
264+ }
255265 }
256266 }
257267 }
0 commit comments