Chapter Contents

Previous

Next
FLOATw.d

FLOATw.d



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
optionally specifies the power of 10 by which to divide the value.


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 those 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 may 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.;

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


Chapter Contents

Previous

Next

Top of Page

Copyright 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.