Hi there,
simple question for everybody: I have an external file containing a double-precision floating point number in IEEE 754 standard.
I read the file in binary mode, obtain the number as a byte sequence and want to convert it in a platform-independent manner into an ABAP type f value.
My simplistic approach to mask the byte field with a type F field-symbol doesn't work platform-independently.
Can anybody help?
Thanks and regards,
Rüdiger
report z_endian. start-of-selection. perform start. * --- form start. data: lv_x(8) type x value '405EC00000000000'. * This is the IEEE748 standard representation for the number 123 * See http://babbage.cs.qc.edu/IEEE-754/64bit.html for a calculator field-symbols: <lv_f> type f. assign lv_x to <lv_f> casting. if <lv_f> eq '1.23E2'. * OK for ia64 Itanium / Unix / Non-Unicode / CP 1100 write: / <lv_f>, ': OK'. else. * Not OK for x86 / Linux / Unicode / CP 4103 write: / <lv_f>, ': Not OK'. endif. endform. "start