[ https://issues.apache.org/jira/browse/PHOENIX-2019?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14567436#comment-14567436 ]
Shuxiong Ye commented on PHOENIX-2019: -------------------------------------- The patch above will firstly turn input to double type, and using java.lang.Math related functions to get the result. Note that, for both types BigDecimal and long, when type cast occurs from these two types to double, there will be a loss of precision. java.lang.Math is only support for double. > Implement Build-in math function ln and log > ------------------------------------------- > > Key: PHOENIX-2019 > URL: https://issues.apache.org/jira/browse/PHOENIX-2019 > Project: Phoenix > Issue Type: Sub-task > Reporter: Shuxiong Ye > Assignee: Shuxiong Ye > Attachments: > 0001-PHOENIX-2019-Implement-Build-in-math-function-ln-and.patch > > > Implement math build-in function, ln and log. Example show as below: > ln(dp) natural logarithm ln(2.0) 0.693147180559945 > log(dp) base 10 logarithm log(100.0) 2 > log(b, x) numeric logarithm to base b log(2.0, 64.0) 6.0000000000 -- This message was sent by Atlassian JIRA (v6.3.4#6332)