HELP: Floating point number in binary format TYPE: OBJECT SYNTAX: BIN(TYPE=SYSTEM/IEEE/HFP/DFP,ENDIAN=SYSTEM/BIG/LITTLE/LOCAL)
Reads a binary representation of a floating point number. The result is an FL5-internal neutral real number representation which can be converted to any of the supported target real number representations by a corresponding write converter.
This converter supports the most common binary float sizes: 32, 64, and 128 bit. The input must be 4, 8, or 16 bytes long respectively. Floating point numbers are always signed.
With the TYPE parameter, the binary floating point representation can be selected. The following types are supported:
When reading HFP or DFP data exported from an IBM z/OS mainframe, ENDIAN=BIG must always be specified. IBM z/Architecture stores all floating point numbers in big-endian byte order. Using the default ENDIAN=SYSTEM on a little-endian host (Linux x86_64, Windows) will silently apply little-endian byte order and produce completely wrong results. Always use:
TYPE.FLOAT(FORMAT.BIN(TYPE=HFP ENDIAN=BIG)) TYPE.FLOAT(FORMAT.BIN(TYPE=DFP ENDIAN=BIG))
With the ENDIAN parameter, the byte order of the binary number can be specified. The following values are available:
With the WIDTH parameter, the bit width of the floating point value can be fixed to W32 (4 bytes), W64 (8 bytes), or W128 (16 bytes, HFP128 and DFP128 only). If WIDTH is not set, the width is determined by the length of the input buffer.
NUMBER: TYPE=SYSTEM/IEEE/HFP/DFP - Type of floating point format [SYSTEM]
SYSTEM - Floating-point representation of the system's architectureIEEE - IEEE 754 binary floating-point (platform-independent)HFP - IBM Hexadecimal Floating Point (z/Architecture HFP; COMP-1/COMP-2 on IBM z/OS)DFP - IBM Decimal Floating Point (DFP32/DFP64/DFP128; IEEE 754-2008 decimal interchange)NUMBER: ENDIAN=SYSTEM/BIG/LITTLE/LOCAL - Byte order of the floating point number [SYSTEM]
SYSTEM - Byte order of the default logical systemBIG - Big endian byte orderLITTLE - Little endian byte orderLOCAL - Byte order of the real physical system