What is the result of the following arithmetic operation?
DATA: intTYPEI.
int=5*(3/10).
Problem is they are suggesting the correct answer as 0. But how could this be possible. Need guide on this .
Being a newbie, these types of issues is common i think.
Hi Shantanu,
By looking at the declaration the query looks related to ABAP. So however if its ABAP/PI(Java) yes the answer is 0.
Go through the operator precedence for ABAP or JAVA . The result of 3/10 is returned as 0 and not 0.3 . If you would have declared the int as type Decimal in ABAP then the value would be 1.5
DATA: int TYPE I. int=5*(3/10). Output : 0
DATA: int TYPE P DECIMALS 1. int=5*(3/10). Output : 1.5
Br,
Manoj
You wish to execute this in pi mapping?
Manually if you do answer should be 1.5