yiguolei commented on code in PR #37999:
URL: https://github.com/apache/doris/pull/37999#discussion_r1683078828
##########
be/src/vec/functions/modulo.cpp:
##########
@@ -33,6 +33,19 @@
namespace doris::vectorized {
+template <typename A, typename B>
+inline void throw_if_division_leads_to_FPE(A a, B b) {
+ // http://avva.livejournal.com/2548306.html
+ // (-9223372036854775808 % -1) will cause coredump directly, so check this
case to throw exception, or maybe could return 0 as result
+ if (UNLIKELY(std::is_signed_v<A> && std::is_signed_v<B> && a ==
std::numeric_limits<A>::min() &&
Review Comment:
是不是把b=-1 放第一个,计算更快
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]