+ 4
If you are expecting a floating point value as a result by doing System.out.println(-1/26); consider making one of the values float. System.out.println(-1.0/26); If both LHS and RHS of the division operator are integers, integer division takes place. If one of the operands is float, the operation will return a floating point value.
2nd May 2020, 7:47 AM
Hatsy Rei
Hatsy Rei - avatar