Updated on 2024-12-06 GMT+08:00

Arithmetic Functions

Table 1 Arithmetic functions

No.

MySQL

GaussDB

Difference

1

ABS()

Supported.

-

2

ACOS()

Supported.

-

3

ASIN()

Supported.

-

4

ATAN()

Supported.

-

5

ATAN2()

Supported.

-

6

CEILING()

Supported.

Some operation result types are inconsistent with those in MySQL. If the derived result is of the NUMERIC or integer type and can be stored as an integer type, the result type in MySQL is integer, but is still NUMERIC in GaussDB.

7

COS()

Supported.

-

8

DEGREES()

Supported.

-

9

EXP()

Supported.

-

10

FLOOR()

Supported, with differences.

The return value types of the FLOOR function in GaussDB are different from those in MySQL. When the input parameter type is INT, the return value type is BIGINT in GaussDB, but is INT in MySQL.

Some operation result types are inconsistent with those in MySQL. If the derived result is of the NUMERIC or integer type and can be stored as an integer type, the result type in MySQL is integer, but is still NUMERIC in GaussDB.

11

LN()

Supported.

-

12

LOG()

Supported.

-

13

LOG10()

Supported.

-

14

LOG2()

Supported.

-

15

PI()

Supported.

The precision of the return value of the PI function in GaussDB is different from that in MySQL. It is rounded off to 15 decimal places in GaussDB but to six decimal places in MySQL.

16

POW()

Supported.

-

17

POWER()

Supported.

-

18

RAND()

Supported.

-

19

SIGN()

Supported.

-

20

SIN()

Supported.

-

21

SQRT()

Supported.

-

22

TAN()

Supported.

-

23

TRUNCATE()

Supported.

-

24

CEIL()

Supported.

-