HPlogo HP C/HP-UX Reference Manual: Version A.05.55.02 > Chapter 10 HP C/HP-UX Implementation Topics

Data Types

» 

Technical documentation

Complete book in PDF

 » Table of Contents

 » Index

Data types are implemented in HP C/HP-UX as follows:

  • The char type is signed.

  • All types can have the register storage class, although it is only honored for scalar types. Ten register declarations per function are honored.

  • The signed integer types are represented internally using twos complement form.

  • Structures and unions start and end on an alignment boundary which is that of their most restrictive member.

  • The long long data type cannot be used to declare an array's size.

  • The long long data type is available only under -Ac, -Aa +e, and -Ae compilation modes.

Table 10-1 “HP C/HP-UX Data Types ” lists the sizes and ranges of different HP C/HP-UX data types.

Table 10-1 HP C/HP-UX Data Types

Type

Bits

Bytes

Low Bound

High Bound

Comments

char

8

1

-128

127

Character

signed char

8

1

-128

127

Signed integer

unsigned char

8

1

0

255

Unsigned integer

short

16

2

-32,768

32,767

Signed integer

unsigned short

16

2

0

65,535

Unsigned integer

int

32

4

-2,147,483,648

2,147,483,647

Signed integer

unsigned int

32

4

0

4,294,967,295

Unsigned integer

long (ILP32)

32

4

-2,147,483,648

2,147,483,647

Signed integer

long (LP64)

64

8

-263

263 -1

Signed integer

long long

64

8

-263

263 -1

Signed integer

unsigned long (ILP32)

32

4

0

4,294,967,295

Unsigned integer

unsigned long (LP64)

6480

264 -1

Unsigned integer

unsigned long long

64

8

0

264 -1

Unsigned integer

float

32

4

See (a) below.

See (b) below.

Floating-point

double

64

8

See (c) below.

See (d) below.

Floating-point

long double

128

16

See (e) below.

See (f) below.

Floating-point

enum

32

4

-2,147,483,648

2,147,483,647

Signed integer

 

Comments

In the following comments, the low bounds of float, double, and long double data types are given in their normalized and denormalized forms. Normalized and denormalized refer to the way data is stored. Normalized numbers are represented with a greater degree of accuracy than denormalized numbers. Denormalized numbers are very small numbers represented with fewer significant bits than normalized numbers.

a.

Least normalized: 1.17549435E-38F
Least denormalized: 1.4012985E-45F

b.

3.40282347E+38F

c.

Least normalized: 2.2250738585072014E-308
Least denormalized: 4.9406564584124654E-324

d.

1.7976931348623157E+308

e.

Least normalized: 3.3621031431120935062626778173217526026E-4932L
Least denormalized: 6.4751751194380251109244389582276465525E-4966L

e.

1.1897314953572317650857593266280070162E+4932L

© Hewlett-Packard Development Company, L.P.