JDK-4875088 : Clarify definition of 1-ulp accuracy
  • Type: Enhancement
  • Component: core-libs
  • Sub-Component: java.lang
  • Affected Version: 5.0
  • Priority: P5
  • Status: Resolved
  • Resolution: Fixed
  • OS: generic
  • CPU: generic
  • Submitted: 2003-06-06
  • Updated: 2003-06-27
  • Resolved: 2003-06-27
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
Other
5.0 tigerFixed
Related Reports
Relates :  
Relates :  
Description
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.

Comments
CONVERTED DATA BugTraq+ Release Management Values COMMIT TO FIX: tiger FIXED IN: tiger INTEGRATED IN: tiger tiger-b10
14-06-2004

SUGGESTED FIX Directory src/share/classes/java/lang sccs sccsdiff -r 1.58 -r1.59 Math.java ------- Math.java ------- 50,52c50,52 < * number the exact result should be returned; otherwise, either of < * the two floating-point numbers closest to the exact result may be < * returned. Besides accuracy at individual arguments, maintaining --- > * number, the exact result should be returned; otherwise, either of > * the two floating-point numbers which bracket the exact result may > * be returned. Besides accuracy at individual arguments, maintaining ###@###.### 2003-06-06
06-06-2003

EVALUATION A fine idea. ###@###.### 2003-06-05
05-06-2003