FirebirdSQL logo

TOTALORDER()

Determines the total or linear order of its arguments

Result type

SMALLINT

Syntax
TOTALORDER (decfloat1, decfloat2)
Table 1. TOTALORDER Function Parameters
Parameter Description

decfloatn

Value or expression of type DECFLOAT, or cast-compatible with DECFLOAT

TOTALORDER compares two DECFLOAT values including any special values.The comparison is exact, and returns a SMALLINT, one of:

-1

First value is less than second

0

Values are equal

1

First value is greater than second.

For TOTALORDER comparisons, DECFLOAT values are ordered as follows:

-NaN < -sNaN < -INF < -0.1 < -0.10 < -0 < 0 < 0.10 < 0.1 < INF < sNaN < NaN