[fpc-pascal] Comp type

Mattias Gaertner nc-gaertnma at netcologne.de
Tue Jan 9 23:28:54 CET 2018


On Tue, 09 Jan 2018 22:58:01 +0100
Darius Blaszyk <dhkblaszyk at zeelandnet.nl> wrote:

> By accident I noticed the comp type for the first time. It's an Int64
> but is considered to be a real type. Just out of curiosity, what is the
> use case of such a type, or is this just implemented for compatibility
> reasons?

Comp is Int64 div 10000. So it is a real, but not a float.
This has some advantages computing things like money.
For example it can represent numbers like 0.3 exactly, which is
not possible with double.
Also computing integers is often faster than doubles.

Mattias



More information about the fpc-pascal mailing list