Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Logarithmic expressions

Former Member
0 Likes
1,135

Hi all,

I want to perform logarithmical expressions in ABAP.

For example i want to have the LOG10 from 300 and get it back with another function, which i don't know.

I have 300, i use the line

lv_value := LOG10( 300 ).

to get the value 2,477...... in lv_value.

Now i want to use a function to get back the number 300 from 2,477.....

Does anyone know which function i have to use for that?

Thanks in advance.

Marcel Leeraar.

1 ACCEPTED SOLUTION
Read only

FredericGirod
Active Contributor
0 Likes
704

Use the EXP command

Exp ( Log10 * Ln(10) )

Rgd

Frédéric

Message was edited by: Frédéric Girod

3 REPLIES 3
Read only

FredericGirod
Active Contributor
0 Likes
705

Use the EXP command

Exp ( Log10 * Ln(10) )

Rgd

Frédéric

Message was edited by: Frédéric Girod

Read only

0 Likes
704

Please see the following sample program.



report zrich_0002 .

data: lv_value type p decimals 9.
data: lv_value2 type p decimals 2.


lv_value = log10( 300 ).

write:/ lv_value.

lv_value2 =  exp( lv_value  * log( 10 ) ) .

write:/ lv_value2.

Regards,

Rich Heilman

Read only

Former Member
0 Likes
704

hi,

Chk this out as this is the simplest way to achieve what you wanted.

data: v_num type p, v_exp type p, v_res type p.

v_num = 10.

v_exp = '2.47'.

v_res = v_num ** v_exp.

write 😕 v_res.

Regards,

Jhansi.

Reward points for helpful answers.