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: 

ABAP Float to IEEE-754 Single Precision Conversion

0 Kudos

Hey folks,

I have a business requirement to store a floating point number in the format IEEE-754 single precision (32 bit). I found primitive data type support for Float in ABAP is IEEE-754 double precision (64 bit). I was not able to find any conversion or simple trick to scale the 64bit down to 32 bit, as the encoding is different (length of exponent and mantissa).

I wrote a blog covering the issues I faced:

https://blogs.sap.com/2018/10/12/abap-float-to-ieee-754-single-precision-conversion/

Nevertheless, I am not super happy with the solution, I would highly appreciate if you have a good idea, or faced the same issue and share your solution here.

Thanks in advance

Stefan

0 REPLIES 0