BIN

Synopsis

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)

Description

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:

Arguments