[<<Previous Entry]
[^^Up^^]
[Next Entry>>]
[Menu]
[About The Guide]
REAL Scientific Notation pp 42
Define: Reals encompass the range of 1E-38 through 1E+38.
Purpose: Provides precision mathematics and fractions.
Notes: Overflow during an arithmetic operation with reals causes the
program to halt with an execution error. An underflow condition
results in a zero result.
Reals are illegal to use as:
1) Arguments to the functions Pred and Succ.
2) Index subscripts for arrays.
3) The definition of a set base type.
4) The control variable in For and Case constructs.
5) Subranges.
Format: Reals occupy six bytes in memory, giving a floating point value
with a 40 bit mantissa and an 8 bit 2's exponent.
The exponent is stored in the first (LSB) byte and the mantissa
in the next five bytes.
Bit positions: 0 7 8 47
Component: Exponent LSB mantissa MSB mantissa
The exponent uses binary format with an offset 80 hex.
An exponent of $84 indicates that the value of the mantissa is
to be multiplied by 2 ^ ($84-$80). The multiplier here is $10.
A zero exponent results in a floating point value of zero.
The value of the mantissa is obtained by dividing the 40 bit
unsigned integer by 2 ^ 40. The mantissa is always normalized,
which means that the most significant bit (Byte 5, Bit 7) = 1.
The sign of the mantissa is stored in Byte 5, Bit 7.
The values are 0 for positive, and 1 for a negative number.
Usage:
CONST
RealCon : Real = 1234.0 ; { Trailing zero for whole Reals }
NumVar : Real = 0.1234 ; { Leading zero for fractional Reals }
VAR
RealVar : Real;
FracVar : Real;
BEGIN
FracVar := Pi;
END.
See Also:
Integer
This page created by ng2html v1.05, the Norton guide to HTML conversion utility.
Written by Dave Pearson