Delphi Language Guide Delphi for Microsoft Win32 Delphi for the Microsoft. Net framework



Yüklə 0,84 Mb.
Pdf görüntüsü
səhifə244/294
tarix02.01.2022
ölçüsü0,84 Mb.
#41395
1   ...   240   241   242   243   244   245   246   247   ...   294
DelphiLanguageGuide

Enumerated Types
An enumerated type is stored as an unsigned byte if the enumeration has no more than 256 values and the type
was declared in the 
{$Z1}
 state (the default). If an enumerated type has more than 256 values, or if the type was
declared in the 
{$Z2}
 state, it is stored as an unsigned word. If an enumerated type is declared in the 
{$Z4}
 state,
it is stored as an unsigned double-word.
Real Types
The real types store the binary representation of a sign (+ or -), an exponent, and a significand. A real value has the
form
+/- significand * 2exponent
where the significand has a single bit to the left of the binary decimal point. (That is, 0 <= significand < 2.)
In the figures that follow, the most significant bit is always on the left and the least significant bit on the right. The
numbers at the top indicate the width (in bits) of each field, with the leftmost items stored at the highest addresses.
207


For example, for a Real48 value, e is stored in the first byte, f in the following five bytes, and s in the most significant
bit of the last byte.
The Real48 type
The following discussion of the Real48 type applies only to the Win32 platform. The Real48 type is not supported
on the .NET platform.
On the Win32 platform, a 6-byte (48-bit) Real48 number is divided into three fields:
1 39 8
s f
e
If 0 < e <= 255, the value v of the number is given by
v = (1)^s * 2^(e129) * (1.f)
If e = 0, then v = 0.
The Real48 type can't store denormals, NaNs, and infinities. Denormals become zero when stored in a Real48, while
NaNs and infinities produce an overflow error if an attempt is made to store them in a Real48.
The Single type
A 4-byte (32-bit) Single number is divided into three fields
1 8 23
s e f
The value v of the number is given by
if 0 < e < 255, then v = (1)^s * 2^(e127) * (1.f)
if e = 0 and f <> 0, then v = (1)^s * 2^(126) * (0.f)
if e = 0 and f = 0, then v = (1)^s * 0
if e = 255 and f = 0, then v = (1)^s * Inf
if e = 255 and f <> 0, then v is a NaN
The Double type
An 8-byte (64-bit) Double number is divided into three fields
1 11 52
s e
f
The value v of the number is given by
if 0 < e < 2047, then v = (1)^s * 2^(e1023) * (1.f)
if e = 0 and f <> 0, then v = (1)^s * 2^(1022) * (0.f)
if e = 0 and f = 0, then v = (1)^s * 0
if e = 2047 and f = 0, then v = (1)^s * Inf
if e = 2047 and f <> 0, then v is a NaN
208



Yüklə 0,84 Mb.

Dostları ilə paylaş:
1   ...   240   241   242   243   244   245   246   247   ...   294




Verilənlər bazası müəlliflik hüququ ilə müdafiə olunur ©azkurs.org 2024
rəhbərliyinə müraciət

gir | qeydiyyatdan keç
    Ana səhifə


yükləyin