Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

math.Nextafter(0,1)

Name: Anonymous 2011-12-20 13:47

Why is math.Nextafter(0, 1) = 5e-324?

Name: Anonymous 2011-12-20 15:32

>>7
that was just the comments inside the code, this gem was above it


/**
 * Returns the floating-point number adjacent to the first
 * argument in the direction of the second argument.  If both
 * arguments compare as equal the second argument is returned.
 *
 * <p>
 * Special cases:
 * <ul>
 * <li> If either argument is a NaN, then NaN is returned.
 *
 * <li> If both arguments are signed zeros, <code>direction</code>
 * is returned unchanged (as implied by the requirement of
 * returning the second argument if the arguments compare as
 * equal).
 *
 * <li> If <code>start</code> is
 * &plusmn;<code>Double.MIN_VALUE</code> and <code>direction</code>
 * has a value such that the result should have a smaller
 * magnitude, then a zero with the same sign as <code>start</code>
 * is returned.
 *
 * <li> If <code>start</code> is infinite and
 * <code>direction</code> has a value such that the result should
 * have a smaller magnitude, <code>Double.MAX_VALUE</code> with the
 * same sign as <code>start</code> is returned.
 *
 * <li> If <code>start</code> is equal to &plusmn;
 * <code>Double.MAX_VALUE</code> and <code>direction</code> has a
 * value such that the result should have a larger magnitude, an
 * infinity with same sign as <code>start</code> is returned.
 * </ul>
 *
 * @param start    starting floating-point value
 * @param direction value indicating which of
 * <code>start</code>'s neighbors or <code>start</code> should
 * be returned
 * @return The floating-point number adjacent to <code>start</code> in the
 * direction of <code>direction</code>.
 * @author Joseph D. Darcy
 */




ENTERPRISE COMMENTING BY JOSEPH D. DARCY

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List