When explaining the accuracy of floating-point methods, the current java.lang.Math JavaDoc states:
"Informally, with a 1 ulp error bound, when the exact result is a representable number the exact result should be returned; otherwise, either of the two floating-point numbers closest to the exact result may be returned."
This statement is slightly incorrect; instead of the two closest floating-point values it would be more correct to say one of the bracketing floating-point values. The difference between the two definitions occurs when the exact result is slightly greater than a power of two. In that case, the two closest results would be the power of two and the floating-point number next smaller in magnitude than the power of two. The two braketing numbers would be the power of two and the floating-point number next larger in magnitude. This latter definition is the correct (and intended) one.