You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@xalan.apache.org by Igor Hersht <ig...@ca.ibm.com> on 2004/05/18 19:57:59 UTC

Rounding problems.





Chris Chui just opened a bug
(https://w3.opensource.ibm.com/tracker/?aid=33420)

The specs seems to say nothing about rounding mode on div,
but there are discussions. It is not really a bug.

We have round functions. It my be good idea to round use
use the same rounding, but round for decimal in there is using
double rounding. It is not a good idea because we are losing the main
advantage of decimals - precision.

I am using ROUND_FLOOR mode. I think I should
use ROUND_HALF_EVEN for
a. operators div and mod for float, double and decimal
b. change fn:round-half-to-even(xs:decimal)
to use Bigdecimal rounding (to extend double precision limit).


Igor Hersht
XSLT Development
IBM Canada Ltd., 8200 Warden Avenue, Markham, Ontario L6G 1C7
Office D2-260, Phone (905)413-3240 ; FAX  (905)413-4839


---------------------------------------------------------------------
To unsubscribe, e-mail: xalan-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xalan-dev-help@xml.apache.org


Re: Rounding problems.

Posted by Igor Hersht <ig...@ca.ibm.com>.



No, I understood that rounding and precision on divide is not defined
precisely.
(see
http://lists.w3.org/Archives/Public/public-qt-comments/2004Apr/0037.html).


Igor Hersht
XSLT Development
IBM Canada Ltd., 8200 Warden Avenue, Markham, Ontario L6G 1C7
Office D2-260, Phone (905)413-3240 ; FAX  (905)413-4839


                                                                           
             Joseph Kesselman                                              
             <keshlam@us.ibm.c                                             
             om>                                                        To 
                                       xalan-dev@xml.apache.org            
             05/18/2004 02:17                                           cc 
             PM                                                            
                                                                   Subject 
                                       Re: Rounding problems.              
             Please respond to                                             
                 xalan-dev                                                 
                                                                           
                                                                           
                                                                           
                                                                           








Unless I'm confused, rounding in XSLT conversions and math _should_ be
defined by the XPath spec's reference to schema types, and schema's
definitions of how its types behave...

______________________________________
Joe Kesselman, IBM Next-Generation Web Technologies: XML, XSL and more.
"The world changed profoundly and unpredictably the day Tim Berners Lee
got bitten by a radioactive spider." -- Rafe Culpin, in r.m.filk


---------------------------------------------------------------------
To unsubscribe, e-mail: xalan-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xalan-dev-help@xml.apache.org




---------------------------------------------------------------------
To unsubscribe, e-mail: xalan-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xalan-dev-help@xml.apache.org


Re: Rounding problems.

Posted by Joseph Kesselman <ke...@us.ibm.com>.



Unless I'm confused, rounding in XSLT conversions and math _should_ be
defined by the XPath spec's reference to schema types, and schema's
definitions of how its types behave...

______________________________________
Joe Kesselman, IBM Next-Generation Web Technologies: XML, XSL and more.
"The world changed profoundly and unpredictably the day Tim Berners Lee
got bitten by a radioactive spider." -- Rafe Culpin, in r.m.filk


---------------------------------------------------------------------
To unsubscribe, e-mail: xalan-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xalan-dev-help@xml.apache.org