You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by GitBox <gi...@apache.org> on 2021/05/13 03:10:01 UTC

[GitHub] [arrow] edponce commented on pull request #10274: ARROW-12685: [C++][Compute] Add unary absolute value kernel

edponce commented on pull request #10274:
URL: https://github.com/apache/arrow/pull/10274#issuecomment-840258476


   @cyb70289  I noticed that *clang* removes the check of `if (result < 0)` because it seems that during the analysis it has a rule that the result of `abs` is never negative, but this is not true if the input is `std::numeric_limits<T>::min()`. In other words, it does not considers the overflow case. See https://godbolt.org/z/7bsM4oTMG to observe this effect. I also tested the godbolt example using unknown values at compile-time and observe the same behavior. This behavior is observed across compilers. My conclusion is to follow the form of `abs_2()`.


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

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