Skip to content

ABAP Keyword Documentation →  ABAP - Reference →  Processing Internal Data →  Numerical Calculations →  Numerical Functions →  Examples of numerical functions 

Numerical Functions

This example demonstrates the use of general numerical functions.

Other versions: 7.31 | 7.40 | 7.54

Source Code

    DATA n TYPE decfloat16.
    DATA m TYPE decfloat16 VALUE '-5.55'.

    n = ABS( m ).   WRITE:   'ABS:  ', n.
    n = SIGN( m ).  WRITE: / 'SIGN: ', n.
    n = CEIL( m ).  WRITE: / 'CEIL: ', n.
    n = FLOOR( m ). WRITE: / 'FLOOR:', n.
    n = TRUNC( m ). WRITE: / 'TRUNC:', n.
    n = FRAC( m ).  WRITE: / 'FRAC: ', n.

Description

The output of the program shows how each of the general numerical functions affects the number -5.55.