‎2007 Dec 03 2:58 PM
Hi ABAPers,
I need to calculate the third root in an ABAP-Programm.
(SAP Release 4.6C)
I know of the SQRT function, but that just returns the square root...
--> 1000 = 10 * 10 * 10
The Third root of 1000 is 10...
Does anybody have an idea?
Thanx in advance!
Greetz,
Pieter
‎2007 Dec 03 3:23 PM
You can try like this:
data: num type i,
<b>num1 type f</b>.
10 ** 3 = 1000
which implies :
num1 = 1 / 3.
1000 ** num1 = 10
‎2007 Dec 03 3:08 PM
hi
good
go through this code which ll give you idea about the square root,
DATA : in TYPE f VALUE 16 ,
out TYPE f .
CALL METHOD cl_foev_builtins=>square_root
EXPORTING
im_number = in
IMPORTING
ex_result = out.
WRITE out .
you can try this same for third root.
reward point if helpful.
thanks
mrutyun^
‎2007 Dec 03 3:23 PM
Hi Mrutyunjaya!
Thank you for your reply, I found that one as well, but unfortunately this class is not available in Release 4.6C... (and it´s a Square root function, and I need the third root...)
Thanks though!
‎2007 Dec 03 3:33 PM
Hello
DATA :
F1 TYPE F, Number for which third route is required say 1000
F2 TYPE F, "Temp variable
F3 TYPE F. " Third route value i.e. 10
F2 = LOG( F1 ) / 3.
F3 = exp( F2 ).
Regards
Saket Sharna
‎2007 Dec 03 3:23 PM
You can try like this:
data: num type i,
<b>num1 type f</b>.
10 ** 3 = 1000
which implies :
num1 = 1 / 3.
1000 ** num1 = 10
‎2007 Dec 03 3:29 PM