Ansicht
Dokumentation

ABENFLOATING_POINT_CLASS - FLOATING POINT CLASS

ABENFLOATING_POINT_CLASS - FLOATING POINT CLASS

CL_GUI_FRONTEND_SERVICES - Frontend Services   RFUMSV00 - Advance Return for Tax on Sales/Purchases  
This documentation is copyright by SAP AG.
SAP E-Book

System Class CL_ABAP_MATH

Constants for Minimum and Maximum Values

The class CL_ABAP_MATH contains constants with the limits of the value ranges built-in numeric types.

Example

Display of the minimum and maximum values of numeric types.

Operations with Floating Point Numbers

The class CL_ABAP_MATH contains methods for operations with floating point numbers.

Rounding Binary Floating Point Numbers

The method ROUND_F_TO_15_DECS rounds a binary floating point number to 15 places using commercial rounding.

Note

Commercial rounding to 15 digits can also be achieved using the built-in function round, the result of which, however, has the decfloat34 type.

Example

The example shows how rounding errors in the output formatting of binary floating point numbers can be prevented by two-step rounding using the method ROUND_F_TO_15_DECS. Instead of the method call, the function call round( val = float dec = 15 ) can be used here.

Operations with Decimal Floating Point Numbers

  • The method NORMALIZE returns 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.
  • The method GET_SCALE_NORMALIZED returns the scaling of a normalized decimal floating point number. If the input value has decimal places, the return value 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.

Example

Display of the scaling and precision of a decimal floating point number.






ROGBILLS - Synchronize billing plans   rdisp/max_wprun_time - Maximum work process run time  
This documentation is copyright by SAP AG.

Length: 3643 Date: 20240426 Time: 210046     sap01-206 ( 60 ms )