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

Get Remainder at devision

Former Member
0 Likes
980

hi all,

I am trying to get remainder at devision time, but i can only get the devidand.

Any one know any function or method for getting remainder.

For Eg.

X = 6 / 2.

then remainder is 0.

X = 7 / 2.

then remainder is 1.

i can get the answer 3 and 3.5 symontenously.

Please help me if any one know any option,

Thank You,

Jahnavee Trivedi

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
926

DATA a(2) TYPE n.
a = 17 MOD 3.
WRITE a.

hi all,

I am trying to get remainder at devision time, but i can only get the devidand.

Any one know any function or method for getting remainder.

For Eg.

X = 6 / 2.

then remainder is 0.

X = 7 / 2.

then remainder is 1.

i can get the answer 3 and 3.5 symontenously.

Please help me if any one know any option,

Thank You,

Jahnavee Trivedi

5 REPLIES 5
Read only

Former Member
0 Likes
926

DATA: a(10) TYPE c .

a = '21'.

a = a mod 2.

write: a.

o/p: a = 1.

Read only

Former Member
0 Likes
926

Hello,

Data: X type float.

X = 6 mod 2.

Try this.

Read only

Former Member
0 Likes
927

DATA a(2) TYPE n.
a = 17 MOD 3.
WRITE a.
Read only

Former Member
0 Likes
926

Hi,

do you search in SDN before you post this question????

Regards, Dieter

Read only

0 Likes
926

I dont think he/she did...but I am the first one to answer...yahoooo!

Edited by: BrightSide on May 7, 2009 12:56 PM