The if statement did not match the assignment order.

Project: http://git-wip-us.apache.org/repos/asf/incubator-vxquery/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-vxquery/commit/6aad81ba
Tree: http://git-wip-us.apache.org/repos/asf/incubator-vxquery/tree/6aad81ba
Diff: http://git-wip-us.apache.org/repos/asf/incubator-vxquery/diff/6aad81ba

Branch: refs/heads/prestonc/hash_join
Commit: 6aad81ba0d2005f813e3804e3c2114f24f4bc5b5
Parents: c144950
Author: Preston Carman <[email protected]>
Authored: Tue Apr 1 17:08:38 2014 -0700
Committer: Preston Carman <[email protected]>
Committed: Tue Apr 1 17:08:38 2014 -0700

----------------------------------------------------------------------
 .../vxquery/datamodel/accessors/atomic/XSDecimalPointable.java   | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-vxquery/blob/6aad81ba/vxquery-core/src/main/java/org/apache/vxquery/datamodel/accessors/atomic/XSDecimalPointable.java
----------------------------------------------------------------------
diff --git 
a/vxquery-core/src/main/java/org/apache/vxquery/datamodel/accessors/atomic/XSDecimalPointable.java
 
b/vxquery-core/src/main/java/org/apache/vxquery/datamodel/accessors/atomic/XSDecimalPointable.java
index 0ebcd29..8aca4a0 100644
--- 
a/vxquery-core/src/main/java/org/apache/vxquery/datamodel/accessors/atomic/XSDecimalPointable.java
+++ 
b/vxquery-core/src/main/java/org/apache/vxquery/datamodel/accessors/atomic/XSDecimalPointable.java
@@ -70,9 +70,9 @@ public class XSDecimalPointable extends AbstractPointable 
implements IHashable,
         // TODO double check that precision is not being lost.
         int diff = p - op;
         if (diff > 0) {
-            v = Math.round(v / Math.pow(10, diff));
-        } else if (diff < 0) {
             ov = Math.round(ov / Math.pow(10, diff));
+        } else if (diff < 0) {
+            v = Math.round(v / Math.pow(10, diff));
         }
 
         return v < ov ? -1 : (v > ov ? 1 : 0);

Reply via email to