Does Java have a floor division operator? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Does Java have a floor division operator?

26th Jul 2020, 3:19 AM
Coding coder
Coding coder - avatar
2 Answers
+ 8
Math.floor(x);
26th Jul 2020, 3:25 AM
Anis
Anis - avatar
- 1
/ (division operator) in java. This can applied according to your need in java. int/int = int. If any one is double or float, it result in double.. You can use type casting the result to int type. Or use floor(x/y). Or just store in needed type.
26th Jul 2020, 10:59 AM
Jayakrishna 🇮🇳