Numeric Precedence

The result type of an expression is determined by the operand with the highest type precedence. The numeric precedence order is as follows (highest to lowest):

  • BINARY_DOUBLE

  • BINARY_FLOAT

  • NUMBER

  • TT_BIGINT

  • TT_INTEGER

  • TT_SMALLINT

  • TT_TINYINT

For example, the sum of TT_INTEGER and BINARY_FLOAT values is type BINARY_FLOAT because BINARY_FLOAT has higher numeric precedence. Similarly, the product of NUMBER and BINARY_DOUBLE values is type BINARY_DOUBLE.