cassandra-pr mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] [cassandra] kornilova-l commented on a change in pull request #334: [WIP] CASSANDRA-15232 Avoid result truncate in decimal operations
Date Thu, 08 Aug 2019 10:24:59 GMT
kornilova-l commented on a change in pull request #334: [WIP] CASSANDRA-15232 Avoid result
truncate in decimal operations
URL: https://github.com/apache/cassandra/pull/334#discussion_r306206509
 
 

 ##########
 File path: test/unit/org/apache/cassandra/cql3/functions/OperationFctsTest.java
 ##########
 @@ -456,10 +457,16 @@ public void testSingleOperationsWithLiterals() throws Throwable
                        BigInteger.valueOf(7).divide(BigInteger.valueOf(bigInt))));
 
         assertRows(execute("SELECT a / 5.5, b / 5.5, c / 5.5, d / 5.5, e / 5.5, f / 5.5,
g / 5.5, h / 5.5 FROM %s WHERE a = 1 AND b = 2"),
-                   row(0.18181818181818182, 0.36363636363636365, 0.5454545454545454, 0.7272727272727273,
1.0, 1.1818181818181819, new BigDecimal("1.272727272727272727272727272727273"), new BigDecimal("1.545454545454545454545454545454545")));
+                   row(0.18181818181818182, 0.36363636363636365, 0.5454545454545454, 0.7272727272727273,
1.0, 1.1818181818181819, new BigDecimal("1.27272727272727272727272727272727"), new BigDecimal("1.54545454545454545454545454545455")));
 
         assertRows(execute("SELECT a / 6.5, b / 6.5, c / 6.5, d / 6.5, e / 6.5, f / 6.5,
g / 6.5, h / 6.5 FROM %s WHERE a = 1 AND b = 2"),
-                   row(0.15384615384615385, 0.3076923076923077, 0.46153846153846156, 0.6153846153846154,
0.8461538461538461, 1.0, new BigDecimal("1.076923076923076923076923076923077"), new BigDecimal("1.307692307692307692307692307692308")));
+                   row(0.15384615384615385, 0.3076923076923077, 0.46153846153846156, 0.6153846153846154,
0.8461538461538461, 1.0, new BigDecimal("1.07692307692307692307692307692308"), new BigDecimal("1.30769230769230769230769230769231")));
+
+        assertRows(execute("SELECT h / 200000000000000000000000000000000000 FROM %s WHERE
a = 1 AND b = 2"),
+                   row(new BigDecimal("0.0000000000000000000000000000000000425")));
 
 Review comment:
   This shows that results are not stripped by minimum scale

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: pr-unsubscribe@cassandra.apache.org
For additional commands, e-mail: pr-help@cassandra.apache.org


Mime
View raw message