Skip to content
Member Filters
Show Inherited
Show Protected
Show abstract
GR32🞂TFloatType

TFloat

32-bit single-precision floating point number.

Declaration ​

pascal
type
  TFloat = Single;
  PFloat = ^TFloat;

Description ​

TFloat is a type alias for Single and is used in Graphics32 for historical reasons.

INFO

The original purpose of TFloat was to be able to switch between single- and double-precision by simply redeclaring TFloat as either Single or Double.
However, while this would work most of the time for pure Pascal code, it would in most cases require that all assembler code be duplicated with different versions for the two types.

Today, you can think of TFloat simply as Single. All existing code relies on it and it will not change.

TypeDeclarationDescription
PFloat^TFloatPointer to a TFloat value.
TFloatArrayarray [0..0] of TFloatStatic un-sized array type.
PFloatArray^TFloatArrayPointer to an un-sized array of Single values.
TArrayOfFloatarray of TFloatDynamic array of Single values.