Cube Root Calculation

204 views
Skip to first unread message

Caroline Machado

unread,
Sep 29, 2009, 10:55:11 AM9/29/09
to Jep Java Users
I am fairly new to JEP Java. We are trying to evaluate it for a
requirement in one of our projects. The documentation did not specify
a cube root function. Is there a way to calculate cube roots
accurately using JEP? I was able to get a cube root approximation
using the following expression.

x^(1/3)
where x is the variable.

Thanks in advance for your help.

Nathan Funk

unread,
Sep 29, 2009, 1:22:53 PM9/29/09
to Jep Java Users
Hi Caroline,

Jep lets you extend the built-in functions with custom functions very
easily. So although cube-root is not part of the built-in function set
in version 3.3, you can add whichever implementation you chose with
little code.

Have a look at the documentation at:

http://www.singularsys.com/jep/doc/html/customfunctions.html

And, as you may already know, the Java API provides a cube root
implementation as:

http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Math.html#cbrt%28double%29

Good luck!

Nathan Funk


On Sep 29, 8:55 am, Caroline Machado <caroline.mach...@gmail.com>
wrote:

Caroline Machado

unread,
Sep 29, 2009, 1:40:17 PM9/29/09
to Jep Java Users
thanks Nathan. I looked into implementing custom functions. It seems
rather straightforward.

On Sep 29, 1:22 pm, Nathan Funk <nathan.f...@singularsys.com> wrote:
> Hi Caroline,
>
> Jep lets you extend the built-in functions with custom functions very
> easily. So although cube-root is not part of the built-in function set
> in version 3.3, you can add whichever implementation you chose with
> little code.
>
> Have a look at the documentation at:
>
> http://www.singularsys.com/jep/doc/html/customfunctions.html
>
> And, as you may already know, the Java API provides a cube root
> implementation as:
>
> http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Math.html#cbrt%28do...
Reply all
Reply to author
Forward
0 new messages