#2925: overflow in rat in Arith
Reporter:Roland Haas
Status:new
Milestone:
Version:
Type:bug
Priority:minor
Component:

Comment (by Roland Haas):

Following up on the discussion, one can do the multiplication manually:

// TODO: need special code to handle the case if a or b is int64_min since -int64_min > int64_max (https://en.cppreference.com/w/cpp/numeric/math/abs#Notes)
int64_t save_mult(int64_t a, int64_t b) {
  uint64_t abs_a = std::abs(a);
  uint64_t abs_b = std::abs(b);
  auto upper =<

--
Ticket URL: https://bitbucket.org/einsteintoolkit/tickets/issues/2925/overflow-in-rat-in-arith