TutGetRealFormat


Name

TutGetRealFormat — get the real number format of this computer

Synopsis

T_REAL_FORMAT TutGetRealFormat() 

Arguments

None

Return Values

T_REAL_DEC_D, T_REAL_DEC_G, T_REAL_IEEE, or T_REAL_IBM_370.

Diagnostics

None

Description

TutGetRealFormat returns the format of real numbers on the current computer. Real numbers use one of these formats:

Real numbers are also subject to the same byte order that integers use: they are either big-endian (the most significant byte is stored in the highest byte) or little-endian (the most significant byte is stored in the lowest byte).

Software that transfers data between computers with different number formats, such as between SPARC and VAX machines, needs to know the format of integers and real numbers to convert the data from one format to another.

Caution

None

See Also

TutGetIntFormat

Examples

This example prints the format of real numbers:

switch(TutGetRealFormat()) { 
case T_REAL_DEC_G: 
  TutOut("Real numbers are DEC G format.\n"); 
  break; 
case T_REAL_DEC_D: 
  TutOut("Real numbers are DEC D format.\n"); 
  break; 
case T_REAL_IEEE: 
  TutOut("Real numbers are IEEE format.\n"); 
  break; 
default: 
  TutOut("Unknown real format: %d\n", TutGetRealFormat()); 
} 

TIBCO SmartSockets™ Utilities
Software Release 6.8, July 2006
Copyright © TIBCO Software Inc. All rights reserved
www.tibco.com