You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "izveigor (via GitHub)" <gi...@apache.org> on 2023/04/04 18:01:43 UTC

[GitHub] [arrow-rs] izveigor opened a new issue, #4016: f16::ZERO and f16::ONE are mixed up

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: github-unsubscribe@arrow.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow-rs] tustvold commented on issue #4016: f16::ZERO and f16::ONE are mixed up

Posted by "tustvold (via GitHub)" <gi...@apache.org>.
tustvold commented on issue #4016:
URL: https://github.com/apache/arrow-rs/issues/4016#issuecomment-1500235940

   `label_issue.py` automatically added labels {'arrow'} from #4017


-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow-rs] tustvold closed issue #4016: f16::ZERO and f16::ONE are mixed up

Posted by "tustvold (via GitHub)" <gi...@apache.org>.
tustvold closed issue #4016: f16::ZERO and f16::ONE are mixed up
URL: https://github.com/apache/arrow-rs/issues/4016


-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org