Updated on 2024-05-14 GMT+08:00

Arithmetic Functions

Table 1 Arithmetic functions

No.

MySQL

GaussDB

Difference

1

log2()

Supported.

  • The display of decimal places is different from that in MySQL. Due to the restriction 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, text, and numeric, but only numeric integer strings are supported); set type; NULL type.

2

log10()

Supported.

  • The display of decimal places is different from that in MySQL. Due to the restriction 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, text, and numeric, but only numeric integer strings are supported); set type; NULL type.