FDEC() Function - Convert Binary Float to Decimal

Syntax

FDEC(string{,ERR=lineref})

Description

For BBj-specific information, see the FDEC() Function - BBj.

The FDEC() function accepts an 8-byte floating point format and returns its decimal numeric equivalent.

Parameter

Description

string

String in 8-byte floating point format to be converted to decimal.

ERR=lineref

Branch to be taken if an error occurs during execution.

Because the IEEE 64-bit standard defines a range of magnitudes greater than that of PRO/5, it is possible to get an overflow error (!ERROR=40) for extremely large values. In addition, IEEE defines a precision of approximately 16 digits; therefore, there may be some loss of precision going to PRO/5's 16-digit precision. Finally, commonly used "special values," such as NA or ERR in a spreadsheet generate an !ERROR=40. Check for these values by using a simple string compare.

FDEC() expects IEEE values in natural left-to-right ordering. Therefore, use care when communicating with other applications, such as spreadsheets, because of possible byte/word ordering differences on different systems and different software packages. See also SWAP.

The FBIN() function is complementary to the FDEC() function.

Examples

>PRINT FDEC(SWAP(A$))
3.14

See Also

Functions - Alphabetical Listing