You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@marmotta.apache.org by "ASF GitHub Bot (JIRA)" <ji...@apache.org> on 2016/02/11 13:17:18 UTC
[jira] [Commented] (MARMOTTA-627) Arithmetic operation in Sparql
query not working properly
[ https://issues.apache.org/jira/browse/MARMOTTA-627?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15142648#comment-15142648 ]
ASF GitHub Bot commented on MARMOTTA-627:
-----------------------------------------
GitHub user orinciog opened a pull request:
https://github.com/apache/marmotta/pull/17
MARMOTTA-627: Arithmetic operation in Sparql query not working properly
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/orinciog/marmotta MARMOTTA-627
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/marmotta/pull/17.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #17
----
commit ebb01407edbc296015021dbdfac8dc3aa10dca4a
Author: Octavian Rinciog <oc...@cti.pub.ro>
Date: 2016-02-11T11:55:02Z
MARMOTTA-627 Wrong multiply operation
----
> Arithmetic operation in Sparql query not working properly
> ---------------------------------------------------------
>
> Key: MARMOTTA-627
> URL: https://issues.apache.org/jira/browse/MARMOTTA-627
> Project: Marmotta
> Issue Type: Bug
> Components: KiWi Triple Store
> Affects Versions: 3.4.0
> Environment: Postgresql: 9.3.10
> Server version: Apache Tomcat/7.0.52 (Ubuntu)
> OS Name: Ubuntu 14.04
> OS Version: 3.13.0-74-generic
> Architecture: amd64
> JVM Version: 1.7.0_91-b02
> JVM Vendor: Oracle Corporation
> Marmotta: 3.4.0
> Reporter: Rinciog Octavian
> Labels: Arithmetic
> Original Estimate: 48h
> Remaining Estimate: 48h
>
> Hy,
> I'm trying to calculate some distances and I need to make some arithmetic operations with some numbers below 1.
> Unfortunately, this kind of operation seems not to work with the latest version of Apache Marmotta (I'm using Apache Marmotta built from repo).
> For example, the following query returns -39.5!!!!
> {code}SELECT ( (4.5-4.4)*0.1 as ?c) WHERE {}{code}
> I've tried many combinations with {{xsd:decimal}}, {{xsd:float}}, {{xsd:double}}, but the answer is or 1.000 or -39.5.
> Other examples:
> {code}SELECT (0.1*0.1 as ?c) WHERE {} => 1.00{code}
> {code}SELECT ( 0.10*0.01 as ?c) WHERE {} => 10.0 {code}
> {code}SELECT ( 1.00*3.10 as ?c) WHERE {} => 0.32258064516129032258{code}
> {code}SELECT ( 2.00*4.00 as ?c) WHERE {} => 0.500{code}
> {code}SELECT (xsd:decimal(2.80)*xsd:decimal(3.00) as ?c) WHERE {} => 0.9333{code}
> Thank you,
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)