HELP: Floating point number in binary format TYPE: OBJECT SYNTAX: BIN(TYPE=SYSTEM/IEEE/HFP/DFP,ENDIAN=SYSTEM/BIG/LITTLE/LOCAL,WIDTH=num/W32/W64/W128)
Writes a binary floating point representation of a real number, taking an FL5-internal neutral real number representation (produced by the reading counterpart) as input.
This converter supports the most common binary floating point sizes: 32, 64, and 128 bit. The output is 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 writing HFP or DFP data intended for 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 write little-endian byte order, producing data that cannot be read correctly on the mainframe. 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:
The desired binary floating point width can be specified in two ways:
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 systemNUMBER: WIDTH=num/W32/W64/W128 - Width of floating point number in bits [64]
W32 - 32 bit floatW64 - 64 bit floatW128 - 128 bit float (HFP128 or DFP128)