D2F

Syntax:

D2F(rexxnum[,float-type][,synerrval])

Arguments:

rexxnum
the REXX number to be converted. The number can be any valid REXX number.
float-type
indicates the desired size for the floating point result. The following values may be specified:
'SHORT'
Indicates a short (4 byte) floating point result is desired. This is the default.
'LONG'
Indicates a long (8 byte) floating point result is desired.
synerrval
indicates the value to be returned if a syntax error is detected. This argument can be used to handle normally occurring, but invalid, data. For example, null strings.

Module Name:

SWXD2F

Service Description:

The D2F function is used to convert printable REXX decimal numbers into the System 370 floating point format. The short floating point format is 4 bytes in length and is compatible with a declaration of FLOAT DEC(6) in PL/I and COMPUTATIONAL-1 in COBOL. The long floating point format is 8 bytes in length and is compatible with a declaration of FLOAT DEC(16) in PL/I and COMPUTATIONAL-2 in COBOL.

Returned Information:

The D2F function returns the System 370 floating point representation of rexxnum. If you CALL the D2F function, the returned value is contained in the RESULT special variable. The RC special variable is unchanged.

Examples:

  1. Call the D2F function to convert the REXX decimal number 3.14 to the short (4 byte) floating point format.
    sfloat = d2f(3.14)
    /* sfloat = '41323d70'x */
    

© Copyright 1998 by Open Software Technologies, Inc.