public static double nextUp(final double start){
  if (start < Double.POSITIVE_INFINITY) {
    final long bits=Double.doubleToRawLongBits(start + 0.0);
    return Double.longBitsToDouble(bits + (bits >= 0 ? 1 : -1));
  }
 else   if (start == Double.POSITIVE_INFINITY) {
    return Double.POSITIVE_INFINITY;
  }
 else {
    return start;
  }
}

public static double nextUp ( final double start ) { if ( start < Double . POSITIVE_INFINITY ) { final long bits = Double . doubleToRawLongBits ( start + 0.0 ) ; return Double . longBitsToDouble ( bits + ( bits >= 0 ? 1 : - 1 ) ) ; } else if ( start == Double . POSITIVE_INFINITY ) { return Double . POSITIVE_INFINITY ; } else { return start ; } }
semantically equivalent to nextafter ( start , double . positive_infinity ) .
