https://saxonica.plan.io/https://saxonica.plan.io/favicon.ico2022-07-29T10:10:23ZSaxonica Developer CommunitySaxon - Bug #5622: SaxonCS 11.4.0 - Division function generating 50 decimal placeshttps://saxonica.plan.io/issues/5622?journal_id=215012022-07-29T10:10:23ZMichael Kaymike@saxonica.com
<ul></ul><p>Thanks for reporting it. SaxonCS is using a completely different software library to support decimal arithmetic; we didn't go out of our way to change the default precision for decimal division, but it's not surprising that it's changed, and the XPath specification doesn't require a specific number of digits. You can round the value to any precision you like using the <code>round</code> (or <code>round-half-to-even</code>) function, and there's also a Saxon extension function saxon:decimal-divide that gives a user-specified precision.</p>
<p>We'll think about changing the code to do what the documentation for saxon:decimal-divide says we do:</p>
<p><em>(The default for decimal division in Saxon using the div operator is to return max(18, s1, s2) decimal places in the result, where s1 is the scale of the first operand and s2 the scale of the second.)</em></p>
<p>Alternatively, we'll update the documentation. (In fact we need to do that anyway, because the Singulink library that we use in SaxonCS doesn't have the concept of the "scale" of a decimal value.)</p> Saxon - Bug #5622: SaxonCS 11.4.0 - Division function generating 50 decimal placeshttps://saxonica.plan.io/issues/5622?journal_id=217162022-09-02T23:39:40ZMichael Kaymike@saxonica.com
<ul><li><strong>Category</strong> set to <i>Internals</i></li><li><strong>Status</strong> changed from <i>New</i> to <i>Resolved</i></li><li><strong>Assignee</strong> set to <i>Michael Kay</i></li><li><strong>Priority</strong> changed from <i>Low</i> to <i>Normal</i></li><li><strong>Applies to branch</strong> <i>trunk</i> added</li><li><strong>Fix Committed on Branch</strong> <i>trunk</i> added</li></ul><p>I have changed the implementation of decimal division to use 18 digits of precision so we get the same results as SaxonJ.</p> Saxon - Bug #5622: SaxonCS 11.4.0 - Division function generating 50 decimal placeshttps://saxonica.plan.io/issues/5622?journal_id=224592023-01-13T18:59:40ZO'Neil Delprattoneil@saxonica.com
<ul><li><strong>Fixed in Maintenance Release</strong> <i>12.0</i> added</li><li><strong>Fixed in Maintenance Release</strong> deleted (<del><i>11.4</i></del>)</li></ul><p>Bug issue fix applied in the Saxon 12.0 Major Release.
Leaving this bug marked as Resolved until fix applied on the Saxon 11 branch.</p> Saxon - Bug #5622: SaxonCS 11.4.0 - Division function generating 50 decimal placeshttps://saxonica.plan.io/issues/5622?journal_id=228452023-02-08T15:46:49ZO'Neil Delprattoneil@saxonica.com
<ul><li><strong>Fixed in Maintenance Release</strong> <i>11.5</i> added</li></ul><p>Bug applied in the Saxon 11.5 Maintenance release.</p> Saxon - Bug #5622: SaxonCS 11.4.0 - Division function generating 50 decimal placeshttps://saxonica.plan.io/issues/5622?journal_id=228782023-02-08T15:49:19ZO'Neil Delprattoneil@saxonica.com
<ul><li><strong>Status</strong> changed from <i>Resolved</i> to <i>Closed</i></li></ul>