History | Log In     View a printable version of the current page. Get help!  
Issue Details [XML]

Key: SES-1063
Type: Bug Bug
Status: Resolved Resolved
Resolution: Fixed
Priority: Major Major
Assignee: Jeen Broekstra
Reporter: Jeen Broekstra
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Sesame

integer division should set higher scale

Created: 19/Jul/12 02:31 AM   Updated: 23/Jul/12 10:35 PM
Component/s: SPARQL
Affects Version/s: None
Fix Version/s: 2.6.9


 Description   
Currently, in sparql, doing

select ?v where { bind( 1/3 as ?v) }

results in:

 "0"^^xsd:decimal

This is caused by the fact that MathUtil uses the input scales as defining the scale of the output decimal. Since we are dividing integers, the scale is zero, by definition.
An improvement would be to explicitly set the scale on divisions that result in non-terminating decimal sequences. An arbitrary number that seems suitable is 24 digits.



 All   Comments   Change History      Sort Order:
Comment by Jeen Broekstra [23/Jul/12 10:35 PM]
Reclassified as a bug after all, since the xsd spec has this to say about xsd:decimal precision:

"All - minimally conforming- processors - must- support decimal numbers with a minimum of 18 decimal digits (i.e., with a - totalDigits- of 18). However, - minimally conforming- processors - may- set an application-defined limit on the maximum number of decimal digits they are prepared to support, in which case that application-defined maximum
number - must- be clearly documented. "