Prev Up Next Index
Go backward to 3 Format Descriptions for Tabular Data
Go up to 3 Format Descriptions for Tabular Data
Go forward to 3.2 FreeForm ND File Types

3.1 FreeForm ND Variable Types

The data sets you produce and use may contain a variety of variable types. The characteristics of the types that FreeForm ND supports are summarized in table 3.1, which is followed by a description of each type.

FreeForm ND Data Types
 

Name Minimum Value Maximum Value Size in Bytes Precision*
char **
uchar 0 255 1
short -32,767 32,767 2
ushort 0 65,535 2
long -2,147,483,647 2,147,483,647 4
ulong 0 4,294,967,295 4
float 10-37 1038 4 6***
double 10-307 10308 8 15***
* Expressed as the number of significant digits
** User-specified
*** Can vary depending on environment

NOTE: The sizes in table 3.1 are machine-dependent.

Those given are for most Unix workstations.

char
The char variable type is used for character strings. Variables of this type, including numerals, are interpreted as characters, not as numbers.
uchar
The uchar (unsigned character) variable type can be used for integers between 0 and 255 (28- 1). Variables that can be represented by the uchar type (for example: month, day, hour, minute) occur in many data sets. An advantage of using the uchar type in binary formats is that only one byte is used for each variable. Variables of this type are interpreted as numbers, not characters.
short
A short variable can hold integers between -32,767 and 32,767 (215- 1). This type can be used for signed integers with less than 5 digits, or for real numbers with a total of 4 or fewer digits on both sides of the decimal point (-99 to 99 with a precision of 2, -999 to 999 with a precision of 1, and so on).
ushort
A ushort (unsigned short) variable can hold integers between 0 and 65,535 (216 - 1).
long
A long variable can hold integers between -2,147,483,647 and +2,147,483,647 (231 - 1). This variable type is commonly used to represent floating point data as integers, which may be more portable. It can be used for numbers with 9 or fewer digits with up to 9 digits of precision, for example, latitude or longitude (-180.000000 to 180.000000).
ulong
The ulong (unsigned long) variable type can be used for integers between 0 and 4,294,967,295 (232 - 1).
float, double
Numbers that include explicit decimal points are either float or double depending on the desired number of digits. A float has a maximum of 6 significant digits, a double has 15 maximum. The extra digits of a double are useful, for example, for precisely specifying time of day within a month as decimal days. One second of time is approximately 0.00001 day. The number specifying day (maximum = 31) can occupy up to 2 digits. A float can therefore only specify decimal days to a whole second (31.00001 occupies seven digits). A double can, however, be used to track decimal parts of a second (for example, 31.000001).
header
Older versions of FreeForm ND included header variables. You can now specify header formats in format description files. For details, see Section 3.4 and also Chapter 5.

Tom Sgouros and James Gallagher, 2006-02-12

Prev Up Next