Skip to content

ABAP Keyword Documentation →  ABAP - Reference →  Processing Internal Data →  Numerical Calculations →  System Classes for Mathematical Operations 

Operations with Floating Point Numbers

Class CL_ABAP_MATH contains methods and constants for operations with floating point numbers.

Other versions: 7.31 | 7.40 | 7.54

Rounding binary floating point numbers

Method ROUND_F_TO_15_DECS rounds a binary floating point number arithmethically to 15 decimal places.

Operations with decimal floating point numbers

  • The method NORMALIZE gets a normalized floating point number. This means that the scaling and precision of an input value are changed so that the mantissa has no trailing zeros.

  • Method GET_SCALE_NORMALIZED returns the scaling of a decimal floating point number. If the input value has decimal places, the return code is the number of decimal places without trailing zeros.

  • The method GET_MAX_DB_VALUE returns the maximum value of a number of the type DF16_DEC or DF34_DEC on the database.

  • The method GET_DB_LENGTH_DECS returns the length and number of decimal places of a number of the type DF16_DEC or DF34_DEC on the database.

Note

The rounding functions round and rescale can be used to round and rescale decimal floating point numbers.