MCPcopy Create free account
hub / github.com/davidgiven/luje / min

Method min

lib/java/lang/StrictMath.java:582–595  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 2

doubleToLongBitsMethod · 0.95
floatToIntBitsMethod · 0.95

Tested by

no test coverage detected