As a bug report, I've found that SPARQL queries that perform
calculations return incorrect results when the number is completely
written out (3600000000), while correct results are given when
scientific notation is used (3.6E9).
3 600 000 000
--
You received this message because you are subscribed to the Google Groups "4store-support" group.
To post to this group, send email to 4store-...@googlegroups.com.
To unsubscribe from this group, send email to 4store-suppor...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/4store-support?hl=en.
As a bug report, I've found that SPARQL queries that perform
calculations return incorrect results when the number is completely
written out (3600000000), while correct results are given when
scientific notation is used (3.6E9).
I'm running 4store 1.1.2 with Raptor version 2.0.2 and Rasqal version
0.9.25, and tested this using 4s-query as shown below.
[...]
Hi,I believe that problem is caused by integer handling in 4-store. 3600000000 is considered as an integer, but outside limit handled correctly by 4-store. 3.6E9 on the other hand is recognized as an double and uses floating point aritmethic which is handles much larger values (however with limited precision). You can force doubles by addin ".0" to numbers, e.g. 3600000000.0 or explicitly declaring type "3600000000"^^<http://www.w3.org/2001/XMLSchema#double>.
Cezary
On Fri, Apr 8, 2011 at 12:53 AM, Chris <c_b...@yahoo.com> wrote:As a bug report, I've found that SPARQL queries that perform
calculations return incorrect results when the number is completely
written out (3600000000), while correct results are given when
scientific notation is used (3.6E9).
I'm running 4store 1.1.2 with Raptor version 2.0.2 and Rasqal version
0.9.25, and tested this using 4s-query as shown below.
[...]
There's a series approximation that's used to calculate 1/x, and it introduces rounding errors.
int / int -> decimal
float / float -> float
There's a todo item to try and drop in one of the free arbitrary precision libraries, but it introduces complex memory management issues.
- Steve