HaoYang670 commented on code in PR #2643:
URL: https://github.com/apache/arrow-rs/pull/2643#discussion_r962226978


##########
arrow/src/compute/kernels/arithmetic.rs:
##########
@@ -1042,15 +1196,18 @@ pub fn divide_dyn(left: &dyn Array, right: &dyn Array) 
-> Result<ArrayRef> {
 /// Perform `left / right` operation on two arrays without checking for 
division by zero.
 /// The result of dividing by zero follows normal floating point rules.

Review Comment:
   > Do you mean "The result of dividing by zero follows normal floating point 
rules"?
   
   Yes. But why `follows normal floating point rules` here ? It seems like the 
function has supported other numeric types. (`T: datatypes::ArrowNumericType`)
   
   > I think this is not changed? It will panic as usual.
   
   Nope, but float will never panic. `Divide by zero` in float type gives `inf` 
or `nan`. 
https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=972d301e807f9a6cfd2ba644b763b86c
   
   Maybe it is better to doc the different behaviour between `float` and other 
types
   ```
   for float, dividing by zero follows the normal floating point rules,
   for other numeric types, dividing be zero will panic,
   ...
   ```



-- 
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