FirebirdSQL logo

Examples of QUANTIZE

select v, pic, quantize(v, pic) from examples;

     V    PIC QUANTIZE
====== ====== ========
  3.16  0.001    3.160
  3.16   0.01     3.16
  3.16    0.1      3.2
  3.16      1        3
  3.16   1E+1     0E+1
  -0.1      1       -0
     0   1E+5     0E+5
   316    0.1    316.0
   316      1      316
   316   1E+1   3.2E+2
   316   1E+2     3E+2

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