code: public BigInteger trunc() {
          /* is already integer: return the numerator
           */
          if (b.compareTo(BigInteger.ONE) == 0) {
              return a;
          } else {
              return a.divide(b);
          }
      }
docs: Remove the fractional part.
  
  @return The integer rounded towards zero.