FirebirdSQL logo

COMPARE_DECFLOAT()

Compares two DECFLOAT values to be equal, different or unordered

Result type

SMALLINT

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

decfloatn

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

The result is a SMALLINT value, as follows:

0

Values are equal

1

First value is less than second

2

First value is greater than second

3

Values are unordered, i.e. one or both is NaN/sNaN

Unlike the comparison operators (‘<’, ‘=’, ‘>’, etc.), comparison is exact: COMPARE_DECFLOAT(2.17, 2.170) returns 2 not 0.