There are two types of division in Java—integer division and floating-point division. Both types use the forward slash (/) symbol as the operator, following the format dividend / divisor . [1] X Research source Read on to learn how to divide two integers (non-decimal whole numbers) to receive an integer quotient, and how to use floating point division to get a decimal result.
Steps
Expert Q&A
Ask a Question
200 characters left
Include your email address to get a message when this question is answered.
Submit
Advertisement
Video
Tips
- When dividing mixed integer and floating point numbers, the floating point values ( float or double ) are automatically converted to the double type when dividing. [6] X Research sourceThanks
Submit a Tip
All tip submissions are carefully reviewed before being published
Thanks for submitting a tip for review!
Advertisement
References
- ↑ https://codegym.cc/groups/posts/integer-division-java
- ↑ https://mathworld.wolfram.com/IntegerDivision.html
- ↑ https://docs.oracle.com/javase/7/docs/api/java/lang/ArithmeticException.html
- ↑ https://github.com/processing/processing/wiki/Troubleshooting
- ↑ https://docs.oracle.com/javase/specs/jls/se15/html/jls-15.html#jls-15.17
- ↑ https://learn.saylor.org/mod/book/tool/print/index.php?id=26807
About This Article
Thanks to all authors for creating a page that has been read 117,362 times.
Advertisement