Skip to content
Member Filters
Show Inherited
Show Protected
Show abstract
GR32_LowLevel🞂Fast Rounding FunctionsFunction

Fast Rounding Functions

High-performance alternatives to standard RTL Round, Trunc, Floor, and Ceil operations.

Declarations ​

pascal
function FastFloor(Value: TFloat): Integer; overload;
function FastFloor(Value: Double): Integer; overload;
function FastCeil(Value: TFloat): Integer; overload;
function FastCeil(Value: Double): Integer; overload;
function FastTrunc(Value: TFloat): Integer;
function FastRound(Value: TFloat): Integer;
function FastFloorSingle(Value: TFloat): Integer;
function FastFloorDouble(Value: Double): Integer;
function FastCeilSingle(Value: TFloat): Integer;
function FastCeilDouble(Value: Double): Integer;
Overload Details

Overload 1 ​

pascal
function FastFloor(Value: TFloat): Integer; overload;

Computes the greatest integer less than or equal to Value (Single precision).

ParameterTypeDescription
ValueTFloatFloating-point single value.
TypeDescription
IntegerFloor of Value as an Integer.

Overload 2 ​

pascal
function FastFloor(Value: Double): Integer; overload;

Computes the greatest integer less than or equal to Value (Double precision).

ParameterTypeDescription
ValueDoubleFloating-point double value.
TypeDescription
IntegerFloor of Value as an Integer.

Overload 3 ​

pascal
function FastCeil(Value: TFloat): Integer; overload;

Computes the smallest integer greater than or equal to Value (Single precision).

ParameterTypeDescription
ValueTFloatFloating-point single value.
TypeDescription
IntegerCeil of Value as an Integer.

Overload 4 ​

pascal
function FastCeil(Value: Double): Integer; overload;

Computes the smallest integer greater than or equal to Value (Double precision).

ParameterTypeDescription
ValueDoubleCeil of Value as an Integer.

Overload 5 ​

pascal
function FastTrunc(Value: TFloat): Integer;

Truncates floating-point Value to Integer towards zero.

ParameterTypeDescription
ValueTFloatFloating-point value.
TypeDescription
IntegerTruncated integer.

Overload 6 ​

pascal
function FastRound(Value: TFloat): Integer;

Rounds floating-point Value to the nearest Integer.

ParameterTypeDescription
ValueTFloatFloating-point value.
TypeDescription
IntegerNearest integer value.

Overload 7 ​

pascal
function FastFloorSingle(Value: TFloat): Integer;

Fast floor operation for Single precision.

ParameterTypeDescription
ValueTFloatSingle-precision float value.
TypeDescription
IntegerFloor integer.

Overload 8 ​

pascal
function FastFloorDouble(Value: Double): Integer;

Fast floor operation for Double precision.

ParameterTypeDescription
ValueDoubleDouble-precision float value.
TypeDescription
IntegerFloor integer.

Overload 9 ​

pascal
function FastCeilSingle(Value: TFloat): Integer;

Fast ceiling operation for Single precision.

ParameterTypeDescription
ValueTFloatSingle-precision float value.
TypeDescription
IntegerCeil integer.

Overload 10 ​

pascal
function FastCeilDouble(Value: Double): Integer;

Fast ceiling operation for Double precision.

ParameterTypeDescription
ValueDoubleDouble-precision float value.
TypeDescription
IntegerCeil integer.

Description ​

The fast rounding routines (FastFloor, FastCeil, FastTrunc, FastRound, FastFloorSingle, FastFloorDouble, FastCeilSingle, FastCeilDouble) provide optimized replacements for standard Pascal Runtime Library (RTL) floating-point conversion routines.

When CPU instruction set extensions are available at runtime (such as SSE2 or SSE4.1), Graphics32 binds the rounding function delegates (FastTrunc, FastRound, FastFloorSingle, FastFloorDouble, FastCeilSingle, FastCeilDouble) to specialized hardware-accelerated SIMD implementations.