private static int floorDiv(int x, int y) {
    int r = x / y;
    // if the signs are different and modulo not zero, round down
    if ((x ^ y) < 0 && (r * y != x)) {
      r--;
    }
    return r;
  }
Copied from the API 24+ AOSP source.
lottie/src/main/java/com/airbnb/lottie/animation/content/RoundedCornersContent.java