[fpc-pascal] Comp type
tony.whyman at mccallumwhyman.com
Wed Jan 10 16:22:44 CET 2018
Thanks for the history. Comp has always puzzled me before, especially
with these two functions from the RTL
function MSecsToTimeStamp(MSecs: Comp): TTimeStamp;
function TimeStampToMSecs(const TimeStamp: TTimeStamp): comp;
I assume that these have come down from Turbo Pascal - but it still
seems odd that milliseconds is represented by a "real" type.
On 10/01/18 08:04, Jonas Maebe wrote:
> Mattias Gaertner wrote:
>> Comp is Int64 div 10000.
> No, that is currency. Comp is a plain 64 bit integer. It originally
> comes from Turbo Pascal, which did not have a regular 64 bit integer
> type. The x87 fpu can be used to perform 64 bit integer math though, so
> it was originally a 64 bit integer type whose calculations were
> performed using the fpu.
> In FPC, it's the same on platforms that still use the x87 fpu. On other
> platforms, comp is an alias for the int64 type.
> fpc-pascal maillist - fpc-pascal at lists.freepascal.org
More information about the fpc-pascal