Java BigInteger divideAndRemainder() methodLast Updated : 17 Mar 2025 The divideAndRemainder() methodof java BigInteger class returns an array of two BigIntegerswith being the first one be the quotient while second index corresponds to the remainder. Syntax:Parameter:val-value by which this BigInteger is to be divided, and the remainder computed. Returns:An array of two BigIntegers: the quotient (this / val) is the initial element, and the remainder (this % val) is the final element. Throws:ArithmeticException- if val is zero. Example 1Output: Result of divideAndRemainderoperaion : Quotient is -37 Remainder is 0 Example 2Output: java.lang.ArithmeticException: BigInteger divide by zero Next TopicJava BigInteger |
We request you to subscribe our newsletter for upcoming updates.

We deliver comprehensive tutorials, interview question-answers, MCQs, study materials on leading programming languages and web technologies like Data Science, MEAN/MERN full stack development, Python, Java, C++, C, HTML, React, Angular, PHP and much more to support your learning and career growth.
G-13, 2nd Floor, Sec-3, Noida, UP, 201301, India