Updated on 2026-05-16 GMT+08:00

Numeric Functions

Table 1 Numeric functions

MySQL

GaussDB

Difference

log2()

Supported with differences

  • The display of decimal places is different from that in MySQL. Due to the limitation of the GaussDB floating-point data type, the extra_float_digits parameter is used to control the number of decimal places to be displayed.
  • Due to the internal processing difference of the input precision, the calculation results of GaussDB and MySQL are different.
  • The following data types are supported:
    • Integer types: bigint, int16, int, smallint, and tinyint
    • Unsigned integer types: bigint unsigned, integer unsigned, smallint unsigned, and tinyint unsigned
    • Floating-point types: numeric and real
    • Character string types: character, character varying, clob, and text. Only numeric integers are supported.
    • Set
    • Null

log10()

Supported with differences

  • The display of decimal places is different from that in MySQL. Due to the limitation of the GaussDB floating-point data type, the extra_float_digits parameter is used to control the number of decimal places to be displayed.
  • Due to the internal processing difference of the input precision, the calculation results of GaussDB and MySQL are different.
  • The following data types are supported:
    • Integer types: bigint, int16, int, smallint, and tinyint
    • Unsigned integer types: bigint unsigned, integer unsigned, smallint unsigned, and tinyint unsigned
    • Floating-point types: numeric and real
    • Character string types: character, character varying, clob, and text. Only numeric integers are supported.
    • Set
    • Null

RAND([seed])

Supported with differences

Due to the random number generation algorithm used internally by the function, the random number returned by the function differs from that in MySQL.