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

Ekaterina Dimitrova commented on CASSANDRA-17221:
-------------------------------------------------

I poked around and I think it is good if we find a library that serves our 
needs instead of this class. [~xvade] did you check any libraries?
I was looking into commons-math but I was not able to find exp or ln functions 
so far.
[~brandon.williams] suggested https://github.com/eobermuhlner/big-math but I am 
not sure we want new dependencies now.
One thing pointed to me by another ASF member was this note from the book 
itself "I wrote all the programs strictly as illustrative examples for this 
book. You’re free to use the source code anyway you like, but bear in mind that 
this is not fully tested, commercial-quality code. Neither Prentice-Hall nor I 
can be responsible for anything bad that may happen if you use these programs."

If we end up using this code we need probably also more particular to that 
class unit tests plus to add the author and his disclaimer.


> Add Math functions 
> -------------------
>
>                 Key: CASSANDRA-17221
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-17221
>             Project: Cassandra
>          Issue Type: Improvement
>          Components: CQL/Syntax
>            Reporter: Benjamin Lerer
>            Assignee: Simon Chess
>            Priority: Normal
>              Labels: AdventCalendar2021, lhf
>             Fix For: 4.x
>
>
> We should add native Maths functions for the most common operations:
> * {{abs\(x)}} returns the absolute value of the x
> * {{exp\(x)}} returns the value of e (the base of natural logarithms) raised 
> to the power of x
> * {{log\(x)}} returns the natural logarithm (base e) of x
> * {{log10\(x)}} returns the base-10 logarithm of x
> * {{round\(x)}} returns the closest integer to x
> +Additional information for newcomers:+
> The new functions should be put in a new class {{MathFcts}} similar to 
> {{TimeFcts}}.
> The {{MathsFcts.all()}} method should be called in 
> {{SystemKeyspace.functions}}
> The unit tests for the functions should be put in a {{MathFctsTest}} similar 
> to {{TimeFctsTest}} 



--
This message was sent by Atlassian Jira
(v8.20.1#820001)

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org
For additional commands, e-mail: commits-h...@cassandra.apache.org

Reply via email to