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

Arithmetic Operation

0 Likes
1,223

What is the result of the following arithmetic operation?

DATA: int TYPE I.
int=5*(3/10).

The actual answer is 0, can anyone please help me with the Logic behind the equaltion?

3 REPLIES 3
Read only

ArthurParisius
Contributor
887

Probably because it does the 3/10 first and converts that to type i before doing the multiplication, resulting in 5 * 0.

Read only

887

And why 3/10 is not temporarily stored as a number with decimals... the answer is here: ABAP documentation - calculation type

Read only

Sandra_Rossi
Active Contributor
0 Likes
887

Title is not searchable.As Arthur Parisius noticed, you could have tested 3/10 which gives 0 too. Then better use title "why does integer division give zero?"