(int x)
| 307 | } |
| 308 | |
| 309 | private static int sqrtFloor(int x) { |
| 310 | // There is no loss of precision in converting an int to a double, according to |
| 311 | // http://java.sun.com/docs/books/jls/third_edition/html/conversions.html#5.1.2 |
| 312 | return (int) Math.sqrt(x); |
| 313 | } |
| 314 | |
| 315 | /** |
| 316 | * Returns the result of dividing {@code p} by {@code q}, rounding using the specified |