Name
Comp Type
Syntax
type Comp;
Description
The Comp
type is a 64-bit signed integer type that
uses the floating-point processor. The Comp
type
exists only for backward compatibility. New programs should use
Int64
instead. The Int64
type
is a true integer type and allows bitwise and shift operations,
supports the full range of the 64-bit type, and is not dependent on
the floating-point control word.
Tips and Tricks
To use the full 64-bit precision of the
Comp
type, the floating-point control word must be set to extended precision. Some Microsoft and other DLLs change the floating-point control word to double or single precision, thereby reducing theComp
type to 53 or fewer bits.Delphi’s I/O and the formatting routines in the
SysUtils
unit do not support the full range of theComp
type. Values near the limits of theComp
type are printed with less precision than is actually stored in theComp
variable. Most applications will not encounter this limitation.
See Also
CompToCurrency Function, CompToDouble Function, CurrencyToComp Procedure, DoubleToComp Procedure, Extended Type, Int64 Type |
Get Delphi in a Nutshell now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.