Previous Page | Next Page

Formats

FLOATw.d Format



Generates a native single-precision, floating-point value by multiplying a number by 10 raised to the dth power.
Category: Numeric
Alignment: left

Syntax
Syntax Description
Details
Comparisons
Examples

Syntax

FLOATw.d

Syntax Description

w

specifies the width of the output field.

Requirement: width must be 4
d

specifies the power of 10 by which to multiply the value. This argument is optional.

Default: 0
Range: 0-31

Details

This format is useful in operating environments where a float value is not the same as a truncated double. Values that are written by FLOAT4. typically are values that are meant to be read by some other external program that runs in your operating environment and that expects these single-precision values.

Note:   If the value that is to be formatted is a missing value, or if it is out-of-range for a native single-precision, floating-point value, a single-precision value of zero is generated.  [cautionend]

On IBM mainframe systems, a four-byte floating-point number is the same as a truncated eight-byte floating-point number. However, in operating environments using the IEEE floating-point standard, such as IBM PC-based operating environments and most UNIX operating environments, a four-byte floating-point number is not the same as a truncated double. Hence, the RB4. format does not produce the same results as the FLOAT4. format. Floating-point representations other than IEEE might have this same characteristic.


Comparisons

The following table compares the names of float notation in several programming languages:

Language Float Notation
SAS FLOAT4
Fortran REAL+4
C float
IBM 370 ASM E
PL/I FLOAT BIN(21)


Examples

put x float4.;

Value of x Results*
1
3F800000
* The result is a hexadecimal representation of a binary number that is stored in IEEE form.

Previous Page | Next Page | Top of Page