You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jena.apache.org by "Damian Steer (Issue Comment Edited) (JIRA)" <ji...@apache.org> on 2011/11/02 17:01:34 UTC

[jira] [Issue Comment Edited] (JENA-153) Query bug for large integers

    [ https://issues.apache.org/jira/browse/JENA-153?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13142226#comment-13142226 ] 

Damian Steer edited comment on JENA-153 at 11/2/11 4:00 PM:
------------------------------------------------------------

I think you're right about an overflow issue here:

select ((20000000000000000000/2) as ?answer) {} => "776627963145224192." ^^<http://www.w3.org/2001/XMLSchema#decimal>
select ((10000000000000000000) as ?answer) {} => "10000000000000000000" ^^<http://www.w3.org/2001/XMLSchema#integer>

Not sure what's going on there.

[edit] But as a guess the latter 'correct' answers are true because both sides are going wrong in the same way.
                
      was (Author: shellac):
    I think you're right about an overflow issue here:

select ((20000000000000000000/2) as ?answer) {} => "776627963145224192." ^^<http://www.w3.org/2001/XMLSchema#decimal>
select ((10000000000000000000) as ?answer) {} => "10000000000000000000" ^^<http://www.w3.org/2001/XMLSchema#integer>

Not sure what's going on there.
                  
> Query bug for large integers
> ----------------------------
>
>                 Key: JENA-153
>                 URL: https://issues.apache.org/jira/browse/JENA-153
>             Project: Jena
>          Issue Type: Bug
>          Components: ARQ, Jena
>            Reporter: Richard Cyganiak
>            Priority: Minor
>
> ARQ handles small xsd:integers fine, and it handles large xsd:integers fine, but there seems to be some weirdness going on with integers of ~20 digits:
> ASK {FILTER (200000/2=100000)} => true
> ASK {FILTER (20000000/2=10000000)} => true
> ASK {FILTER (2000000000/2=1000000000)} => true
> ASK {FILTER (200000000000/2=100000000000)} => true
> ASK {FILTER (20000000000000/2=10000000000000)} => true
> ASK {FILTER (2000000000000000/2=1000000000000000)} => true
> ASK {FILTER (200000000000000000/2=100000000000000000)} => true
> ASK {FILTER (20000000000000000000/2=10000000000000000000)} => ***false***
> ASK {FILTER (2000000000000000000000/2=1000000000000000000000)} => true
> ASK {FILTER (200000000000000000000000/2=100000000000000000000000)} => true
> ASK {FILTER (20000000000000000000000000/2=10000000000000000000000000)} => true
> These were all tested in http://sparql.org/sparql.html with an arbitrary target graph URI.
> It works fine again if dividend and quotient are changed to xsd:decimal:
> ASK {FILTER (20000000000000000000.0/2=10000000000000000000.0)} => true
> I guess this may have something to do with Java's native long being used for xsd:integers of some size, and BigInteger for others?

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira