Returns the most negative (closest to negative infinity) of the two arguments. Special cases: min(NaN, (anything)) = NaN min((anything), NaN) = NaN min(+0.0, -0.0) = -0.0 min(-0.0, +0.0) = -0.0 @param d1 t
(double d1, double d2)
| 580 | * @return the smaller of {@code d1} and {@code d2}. |
| 581 | */ |
| 582 | public static double min(double d1, double d2) { |
| 583 | if (d1 > d2) |
| 584 | return d2; |
| 585 | if (d1 < d2) |
| 586 | return d1; |
| 587 | /* if either arg is NaN, return NaN */ |
| 588 | if (d1 != d2) |
| 589 | return Double.NaN; |
| 590 | /* min( +0.0,-0.0) == -0.0 */ |
| 591 | if (d1 == 0.0 |
| 592 | && ((Double.doubleToLongBits(d1) | Double.doubleToLongBits(d2)) & 0x8000000000000000l) != 0) |
| 593 | return 0.0 * (-1.0); |
| 594 | return d1; |
| 595 | } |
| 596 | |
| 597 | /** |
| 598 | * Returns the most negative (closest to negative infinity) of the two |
nothing calls this directly
no test coverage detected