izveigor opened a new issue, #4016:
URL: https://github.com/apache/arrow-rs/issues/4016

   **Describe the bug**
   DivideByZero occurs when `div_checked` and `mod_checked` are called with the 
argument `f16::ONE`.
   
   **To Reproduce**
   ```
   use half::f16;
   use arrow::array::Float16Array;
   use arrow::datatypes::ArrowNativeTypeOp;
   
   fn main() {
       let arr: Float16Array = [Some(f16::from_f64(1.0)), 
Some(f16::from_f64(2.0))].into_iter().collect();
       println!("{:#?}", arr);
       println!("{:#?}", arr.value(0).div_checked(f16::ONE));
       println!("{:#?}", arr.value(0).mod_checked(f16::ONE));
   }
   ```
   output:
   ```
   PrimitiveArray<Float16>
   [
     1.0,
     2.0,
   ]
   Err(
       DivideByZero,
   )
   Err(
       DivideByZero,
   )
   ```
   
   **Expected behavior**
   output:
   ```
   PrimitiveArray<Float16>
   [
     1.0,
     2.0,
   ]
   1.0
   0.0
   ```
   
   **Additional context**
   <!--
   Add any other context about the problem here.
   -->


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to