Turbo Pascal Help (turbo.tph) |
Index |
0615 |
Real types
----------
A real type has a set of values that is a subset of real numbers, which can
be represented in floating-point notation with a fixed number of digits.
A value's floating-point notation normally is made up of three values--M, B,
and E--such that M x B E = N where B is always 2, and both M and E are
integral values within the real type's range.
Turbo Pascal provides five predefined real types. Each type has a specific
range and precision:
Type | Range | Digits | Bytes
===============================================
real | 2.9e-39..1.7e38 | 11-12 | 6
single | 1.5e-45..3.4e38 | 7-8 | 4
double | 5.0e-324..1.7e308 | 15-16 | 8
extended | 3.4e-4932..1.1e4932 | 19-20 | 10
comp | -9.2e18..9.2e18 | 19-20 | 8
Note: The comp type is a 64-bit integer. It holds only integral values
within the range (-2 63 + 1) to (2 63 - 1).
Turbo Pascal supports two models of floating-point code generation:
- Software floating point, {$N-}
- 80x87 floating point, {$N+}
You use the $N compiler directive to switch between the two models.
In the $N+ state, the $E compiler directive controls whether to include an
8087 software emulation library in the final program.
- eof -