[ https://issues.apache.org/jira/browse/SOLR-12352?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16474989#comment-16474989 ]
Shawn Heisey commented on SOLR-12352: ------------------------------------- Is the mod function actually useful for floating point numbers? I did a simple test in Java code which shows that it *sort of* works, but suffers from precision problems: {code:java} double dv = 5.7; double dms = 2.2; System.out.println(dv % dms); // 1.2999999999999998 {code} I wouldn't have imagined any use for mod with anything other than whole numbers, but maybe that's a failure of imagination on my part. > Solr mod function query does not yield correct results > ------------------------------------------------------ > > Key: SOLR-12352 > URL: https://issues.apache.org/jira/browse/SOLR-12352 > Project: Solr > Issue Type: Bug > Security Level: Public(Default Security Level. Issues are Public) > Affects Versions: 7.3 > Reporter: gnandre > Priority: Minor > > It seems mod operation in function query is not working correctly for large > numbers. > {noformat} > "_version_": 1600463487761383425, > "ms(NOW)": 1526324140364, > "mod(_version_,ms(NOW))": 1280437520000 > {noformat} > > However, mod(1600463487761383425,1526324140364) is 1204927482853. > -- This message was sent by Atlassian JIRA (v7.6.3#76005) --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org For additional commands, e-mail: dev-h...@lucene.apache.org