Skip to content
Permalink
Browse files

8233650: Javadoc for Math.floorMod(int, int) gives wrong example

Reviewed-by: bpb
  • Loading branch information
Ivan Gerasimov
Ivan Gerasimov committed Nov 6, 2019
1 parent 8ca82e3 commit 1c2b406ab5a77adfcc95a2c0217b3484db795626
Showing with 9 additions and 8 deletions.
  1. +9 −8 src/java.base/share/classes/java/lang/Math.java
@@ -1259,16 +1259,17 @@ public static long floorDiv(long x, long y) {
* Examples:
* <ul>
* <li>If the signs of the arguments are the same, the results
* of {@code floorMod} and the {@code %} operator are the same. <br>
* of {@code floorMod} and the {@code %} operator are the same.<br>
* <ul>
* <li>{@code floorMod(4, 3) == 1}; &nbsp; and {@code (4 % 3) == 1}</li>
* <li>{@code floorMod(+4, +3) == +1}; &nbsp; and {@code (+4 % +3) == +1}</li>
* <li>{@code floorMod(-4, -3) == -1}; &nbsp; and {@code (-4 % -3) == -1}</li>
* </ul>
* <li>If the signs of the arguments are different, the results
* differ from the {@code %} operator.<br>
* <ul>
* <li>{@code floorMod(+4, -3) == -2}; &nbsp; and {@code (+4 % -3) == +1}</li>
* <li>{@code floorMod(-4, +3) == +2}; &nbsp; and {@code (-4 % +3) == -1}</li>
* </ul>
* <li>If the signs of the arguments are different, the results differ from the {@code %} operator.<br>
* <ul>
* <li>{@code floorMod(+4, -3) == -2}; &nbsp; and {@code (+4 % -3) == +1} </li>
* <li>{@code floorMod(-4, +3) == +2}; &nbsp; and {@code (-4 % +3) == -1} </li>
* <li>{@code floorMod(-4, -3) == -1}; &nbsp; and {@code (-4 % -3) == -1 } </li>
* </ul>
* </li>
* </ul>
* <p>

0 comments on commit 1c2b406

Please sign in to comment.
You can’t perform that action at this time.