APAR status
Closed as program error.
Error description
If the argument to the round function is greater than zero, but less than 0.1, the processor reports the error message "Digits < 0". If the argument to the function is greater than or equal to 0.1 and less than 1, the processor returns the value of the argument as the result of the function, rather than the rounded result.
Local fix
Problem summary
**************************************************************** * USERS AFFECTED: All IBM WebSphere Application Server Feature* * Pack for XML users * **************************************************************** * PROBLEM DESCRIPTION: For arguments to the fn:round function * * in the range 0 to 1, the processor * * sometimes reports the error "Digits < * * 0" and sometimes returns the argument * * as the result of the function, * * instead of rounding correctly * **************************************************************** * RECOMMENDATION: Install a fix pack that contains this APAR. * **************************************************************** For an argument of type xs:float, xs:double or xs:decimal, the implementation of the fn:round function always represents the value as a java.math.BigDecimal object. It then rounds that BigDecimal value using the BigDecimal.round method, supplying a java.math.MathContext whose precision is equal to the precision of the argument minus the absolute value of its scale. For all values whose absolute value is greater than ore equal to one, that method of calculating the absolute value is correct. However, for a value that is greater than zero but less than 0.1, that yields a negative value, and constructing a MathContext with a precision less than zero results in a Java Exception containing the message, "Digits < 0". For a value that is greater than or equal to 0.1, but less than one, that formula yields a MathContext whose precision is zero, which indicates to the BigDecimal.round function that no rounding should be performed, which results in the argument being returned as the result as the fn:round function
Problem conclusion
The problem was resolved by changing the implementations of the fn:round function for values of type xs:float or xs:double to be a more efficient, correct algorithm that is specific to values of those floating point types, rather representing such values as Java BigDecimal objects. In the case of values of type xs:decimal, the implementation of fn:round was divided into three cases: if the value is less than 0.5 and greater than or equal to -0.5, the implementation returns the result of 0; if the absolute value is less than one, and the value is greater than or equal to 0.5 or less than -0.5, the implementation returns the result of one, for positive values, or negative one, for negative values; otherwise, the implementation computes the result using the existing technique of using the BigDecimal.round method. The fix for this APAR is currently targeted for inclusion in fix pack 1.0.0.9. Please refer to the Recommended Updates page for delivery information: http://www.ibm.com/support/docview.wss?rs=180&uid=swg27004980
Temporary fix
Comments
APAR Information
APAR number
PM33860
Reported component name
XML FEATUREPACK
Reported component ID
5724J0856
Reported release
700
Status
CLOSED PER
PE
NoPE
HIPER
NoHIPER
Special Attention
NoSpecatt
Submitted date
2011-03-01
Closed date
2011-04-15
Last modified date
2011-04-15
APAR is sysrouted FROM one or more of the following:
APAR is sysrouted TO one or more of the following:
Fix information
Fixed component name
XML FEATUREPACK
Fixed component ID
5724J0856
Applicable component levels
R700 PSY
UP
[{"Business Unit":{"code":"BU048","label":"IBM Software"},"Product":{"code":"SUPPORT","label":"IBM Worldwide Support"},"Component":"","ARM Category":[],"Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"1.0","Edition":"","Line of Business":{"code":"","label":""}}]
Document Information
Modified date:
09 February 2022