Application Development 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: 

floor statement - did not use F1...

Former Member
0 Kudos

HI experts.

Can anyone explain to me how to use the floor statement.

Thank you in advanced.

Edited by: Julius Bussche on Sep 8, 2008 7:16 AM

1 ACCEPTED SOLUTION

Former Member
0 Kudos

hi,

Floor statement gives you the greatest integer value of a float quantity.

syntax

DATA A TYPE P DECIMALS 2.
DATA B TYPE P DECIMALS 2 VALUE '-5.55'.


A = FLOOR( B ). WRITE: / 'FLOOR:', N.

Result : 
FLOOR:-6.00

and

DATA A TYPE P DECIMALS 2.
DATA B TYPE P DECIMALS 2 VALUE '5.55'.


A = FLOOR( B ). WRITE: / 'FLOOR:', N.

Result :
FLOOR: 5.00

Regards,

Anirban

4 REPLIES 4

Former Member
0 Kudos

hi,

Floor statement gives you the greatest integer value of a float quantity.

syntax

DATA A TYPE P DECIMALS 2.
DATA B TYPE P DECIMALS 2 VALUE '-5.55'.


A = FLOOR( B ). WRITE: / 'FLOOR:', N.

Result : 
FLOOR:-6.00

and

DATA A TYPE P DECIMALS 2.
DATA B TYPE P DECIMALS 2 VALUE '5.55'.


A = FLOOR( B ). WRITE: / 'FLOOR:', N.

Result :
FLOOR: 5.00

Regards,

Anirban

Former Member

Former Member
0 Kudos

Hi,

I hope the following link will help you,

DATA : n TYPE p DECIMALS 3.

DATA : m TYPE p DECIMALS 3 VALUE '3.44'.

n = floor( m ).

DATA : Q(10) TYPE C.

Q = N.

WRITE:/ Q.

Regards,

Harish

Former Member
0 Kudos

Hi,

Floor always adjust the given floating value to its..lowest integer value...

for ex...if n = 33.75 then it will adjust the value n to 33.00.

where as Ceil to its upper value..

check this

data ant(5) type p DECIMALS 2 value '33.75'.

ant = floor( ant ) .

write ant.