Hi Thomas,
> A patch with simple test cases would be nice (maybe a simple SQL script
> with a few cases). I would like to test this with other databases as well.
>
A simple test case where all columns should be TRUE:
SELECT
(CAST('-0.0' AS DOUBLE)) = (CAST('0.0' AS DOUBLE)),
((CAST('-0.0' AS DOUBLE)) < (CAST('0.0' AS DOUBLE))) = 0,
((CAST('-0.0' AS DOUBLE)) > (CAST('0.0' AS DOUBLE))) = 0,
ABS(CAST('-0.0' AS DOUBLE)) = (CAST('0.0' AS DOUBLE)),
ABS(CAST('0.0' AS DOUBLE)) = (CAST('-0.0' AS DOUBLE)),
ABS(CAST('-0.0' AS DOUBLE)) = (CAST('-0.0' AS DOUBLE)),
CAST('-0.0' AS DOUBLE) = (CAST(-1 AS DOUBLE) * CAST(0 AS DOUBLE)),
(CAST('0.0' AS DOUBLE) = (CAST(-1 AS DOUBLE) * CAST(0 AS DOUBLE))),
((CAST(-1 AS DOUBLE) * CAST(0 AS DOUBLE)) < CAST('0.0' AS DOUBLE)) = 0
Of course, same test works with REAL type.
About the patch, I am not sure where I should look. I guess the idea is to
prevent a negative zero to be produced wherever a DOUBLE/REAL is created.
Any hints?
> The question is, should this change be done in a minor version? I think yes
>
Me too. It is causing various unexpected problems, even more so when
combined with the ABS() sign-changing bug, and should be fixed in a stable
version.
As a side note, I mentioned that the point of signed zero was to produce
+inf and -inf when dividing 1 by zero, which Java does. H2, on the other
hand, raises an error about division by zero. So I guess we are on the
right track in removing the signed zero notion :)
Cheers,
-Christopher
--
You received this message because you are subscribed to the Google Groups "H2
Database" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/h2-database.
For more options, visit https://groups.google.com/d/optout.