JDK-4916097 : Minor exponent over/underflow problem in jsr13 BigDecimal pow(int) method
  • Type: Bug
  • Component: core-libs
  • Sub-Component: java.math
  • Affected Version: 5.0
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • OS: generic
  • CPU: generic
  • Submitted: 2003-09-02
  • Updated: 2003-09-12
  • Resolved: 2003-09-12
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
The pow(int) method added in jsr13 calculates the return value with

return new BigDecimal(intVal.pow(n), scale * n);

This scale calculation is not properly guarded against integer over/underflow, allowing for potentially very misleading results.  Additionally, the calculation of 0^n should probably be special-cased.

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

SUGGESTED FIX See bug 4917089 for diffs. ###@###.### 2003-09-08
08-09-2003

EVALUATION A fine idea. ###@###.### 2003-09-02
02-09-2003