10-12-2018 2:12 PM
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