[ 
https://issues.apache.org/jira/browse/METRON-364?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15727667#comment-15727667
 ] 

ASF GitHub Bot commented on METRON-364:
---------------------------------------

Github user cestella commented on the issue:

    https://github.com/apache/incubator-metron/pull/390
  
    Oops also we will want to preserve Longs.  Down converting to an int will 
lose precision and may end up being inaccurate.  I'd suggest we operate like so:
    * If either are a double then operate as doubles
    * else if either are float then operate as floats
    * else if either are longs then operate as longs
    * else operate as ints


> Stellar - Adding Two Integers Does Not Equal an Integer
> -------------------------------------------------------
>
>                 Key: METRON-364
>                 URL: https://issues.apache.org/jira/browse/METRON-364
>             Project: Metron
>          Issue Type: Bug
>            Reporter: Nick Allen
>              Labels: stellar
>
> A test showing the problem which would be part of 
> org.apache.metron.common.stellar.StellarTest  
> ```java
>       @Test
>       public void testAddIntegers()  throws Exception {
>         String query = "1 + 1";
>         Assert.assertEquals(2, run(query, new HashMap<>()));
>     //    java.lang.AssertionError:
>     //    Expected :2
>     //    Actual   :2.0
>       }
> ```



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to