Chapter Contents

Previous

Next
IEEEw.d

IEEEw.d



Generates an IEEE floating-point value by multiplying a number by 10 raised to the dth power

Category: Numeric
Alignment: left


Syntax
Syntax Description
Details
Examples

Syntax

IEEEw.d

Syntax Description

w
specifies the width of the output field.

Default: 8
Range: 3-8
Tip: If w is 8, an IEEE double-precision, floating-point number is written. If w is 5, 6, or 7, an IEEE double-precision, floating-point number is written, which assumes truncation of the appropriate number of bytes. If w is 4, an IEEE single-precision floating-point number is written. If w is 3, an IEEE single-precision, floating-point number is written, which assumes truncation of one byte.

d
optionally specifies to multiply the number by 10d.


Details

This format is useful in operating environments where IEEEw.d is the floating-point representation that is used. In addition, you can use the IEEEw.d format to create files that are used by programs in operating environments that use the IEEE floating-point representation.

Typically, programs generate IEEE values in single-precision (4 bytes) or double-precision (8 bytes). Programs perform truncation solely to save space on output files. Machine instructions require that the floating-point number be one of the two lengths. The IEEEw.d format allows other lengths, which enables you to write data to files that contain space-saving truncated data.


Examples

test1=put(x,ieee4.); 
put test1 $hex8.;

test2=put(x,ieee5.); 
put test2 $hex10.;

Values Results*
1
3F800000

3FF0000000
*The result contains hexadecimal representations of binary numbers stored in IEEE form.


Chapter Contents

Previous

Next

Top of Page

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