هذه الصفحة غير متوفرة حاليًا بلغتك المحلية. نحن نعمل جاهدين على إضافة المزيد من اللغات. شاكرين تفهمك ودعمك المستمر لنا.

Compute
Elastic Cloud Server
Huawei Cloud Flexus
Bare Metal Server
Auto Scaling
Image Management Service
Dedicated Host
FunctionGraph
Cloud Phone Host
Huawei Cloud EulerOS
Networking
Virtual Private Cloud
Elastic IP
Elastic Load Balance
NAT Gateway
Direct Connect
Virtual Private Network
VPC Endpoint
Cloud Connect
Enterprise Router
Enterprise Switch
Global Accelerator
Management & Governance
Cloud Eye
Identity and Access Management
Cloud Trace Service
Resource Formation Service
Tag Management Service
Log Tank Service
Config
OneAccess
Resource Access Manager
Simple Message Notification
Application Performance Management
Application Operations Management
Organizations
Optimization Advisor
IAM Identity Center
Cloud Operations Center
Resource Governance Center
Migration
Server Migration Service
Object Storage Migration Service
Cloud Data Migration
Migration Center
Cloud Ecosystem
KooGallery
Partner Center
User Support
My Account
Billing Center
Cost Center
Resource Center
Enterprise Management
Service Tickets
HUAWEI CLOUD (International) FAQs
ICP Filing
Support Plans
My Credentials
Customer Operation Capabilities
Partner Support Plans
Professional Services
Analytics
MapReduce Service
Data Lake Insight
CloudTable Service
Cloud Search Service
Data Lake Visualization
Data Ingestion Service
GaussDB(DWS)
DataArts Studio
Data Lake Factory
DataArts Lake Formation
IoT
IoT Device Access
Others
Product Pricing Details
System Permissions
Console Quick Start
Common FAQs
Instructions for Associating with a HUAWEI CLOUD Partner
Message Center
Security & Compliance
Security Technologies and Applications
Web Application Firewall
Host Security Service
Cloud Firewall
SecMaster
Anti-DDoS Service
Data Encryption Workshop
Database Security Service
Cloud Bastion Host
Data Security Center
Cloud Certificate Manager
Edge Security
Managed Threat Detection
Blockchain
Blockchain Service
Web3 Node Engine Service
Media Services
Media Processing Center
Video On Demand
Live
SparkRTC
MetaStudio
Storage
Object Storage Service
Elastic Volume Service
Cloud Backup and Recovery
Storage Disaster Recovery Service
Scalable File Service Turbo
Scalable File Service
Volume Backup Service
Cloud Server Backup Service
Data Express Service
Dedicated Distributed Storage Service
Containers
Cloud Container Engine
SoftWare Repository for Container
Application Service Mesh
Ubiquitous Cloud Native Service
Cloud Container Instance
Databases
Relational Database Service
Document Database Service
Data Admin Service
Data Replication Service
GeminiDB
GaussDB
Distributed Database Middleware
Database and Application Migration UGO
TaurusDB
Middleware
Distributed Cache Service
API Gateway
Distributed Message Service for Kafka
Distributed Message Service for RabbitMQ
Distributed Message Service for RocketMQ
Cloud Service Engine
Multi-Site High Availability Service
EventGrid
Dedicated Cloud
Dedicated Computing Cluster
Business Applications
Workspace
ROMA Connect
Message & SMS
Domain Name Service
Edge Data Center Management
Meeting
AI
Face Recognition Service
Graph Engine Service
Content Moderation
Image Recognition
Optical Character Recognition
ModelArts
ImageSearch
Conversational Bot Service
Speech Interaction Service
Huawei HiLens
Video Intelligent Analysis Service
Developer Tools
SDK Developer Guide
API Request Signing Guide
Terraform
Koo Command Line Interface
Content Delivery & Edge Computing
Content Delivery Network
Intelligent EdgeFabric
CloudPond
Intelligent EdgeCloud
Solutions
SAP Cloud
High Performance Computing
Developer Services
ServiceStage
CodeArts
CodeArts PerfTest
CodeArts Req
CodeArts Pipeline
CodeArts Build
CodeArts Deploy
CodeArts Artifact
CodeArts TestPlan
CodeArts Check
CodeArts Repo
Cloud Application Engine
MacroVerse aPaaS
KooMessage
KooPhone
KooDrive
On this page

Show all

Arithmetic Functions

Updated on 2024-04-19 GMT+08:00
Table 1 Arithmetic functions

Operator

Description

+ numeric

Returns a numeric.

- numeric

Returns the opposite of a numeric.

numeric1 + numeric2

Returns the sum of numeric1 and numeric2.

numeric1 - numeric2

Returns the difference between numeric1 and numeric2.

numeric1 * numberic2

Returns the product of numeric1 and numeric2.

numeric1 / numeric2

Returns the quotient of numeric1 divided by numeric2.

numeric1 % numeric2

Returns the remainder (modulus) of numeric1 divided by numeric2. The result is negative only if numeric1 is negative.

POWER(numeric1, numeric2)

Returns numeric1 raised to the power of numeric2.

ABS(numeric)

Returns the absolute value of numeric.

SQRT(numeric)

Returns the square root of numeric.

LN(numeric)

Returns the natural logarithm (base e) of numeric.

LOG10(numeric)

Returns the logarithm (base 10) of numeric.

LOG2(numeric)

Returns the logarithm (base 2) of numeric.

LOG(numeric2)

LOG(numeric1, numeric2)

When called with one argument, returns the natural logarithm of numeric2. When called with two arguments, returns the logarithm of numeric2 with base numeric1. Numeric2 must be greater than 0 and numeric1 must be greater than 1.

EXP(numeric)

Returns e raised to the power of numeric.

CEIL(numeric)

CEILING(numeric)

Rounds up and returns the smallest integer greater than or equal to numeric.

FLOOR(numeric)

Rounds down and returns the largest integer less than or equal to numeric.

SIN(numeric)

Returns the sine of numeric.

SINH(numeric)

Returns the hyperbolic sine of numeric. The return type is DOUBLE.

COS(numeric)

Returns the tangent of numeric.

TAN(numeric)

Calculates the tangent of given A.

TANH(numeric)

Returns the hyperbolic tangent of numeric. The return type is DOUBLE.

COT(numeric)

Returns the cotangent of numeric.

ASIN(numeric)

Returns the inverse sine of numeric.

ACOS(numeric)

Returns the inverse cosine of numeric.

ATAN(numeric)

Returns the inverse tangent of numeric.

ATAN2(numeric1, numeric2)

Returns the inverse tangent of the coordinate (numeric1, numeric2).

COSH(numeric)

Returns the hyperbolic cosine of numeric. The return type is DOUBLE.

DEGREES(numeric)

Returns the degree representation of the radian numeric.

RADIANS(numeric)

Returns the radian representation of the degree numeric.

SIGN(numeric)

Returns the sign of numeric.

ROUND(numeric, INT)

Returns the value of numeric rounded to INT decimal places.

PI()

Returns a value very close to pi.

E()

Returns a value very close to e.

RAND()

Returns a pseudo-random double-precision value within the range of [0.0, 1.0).

RAND(INT)

Returns a pseudo-random double-precision value within the range of [0.0, 1.0) with an initial seed of INT.

If two RAND functions have the same initial seed, they will return the same sequence of numbers.

RAND_INTEGER(INT)

Returns a pseudo-random integer within the range of [0, INT).

RAND_INTEGER(INT1, INT2)

Returns a pseudo-random integer within the range of [0, INT2) with an initial seed of INT1.

If two RAND_INTEGER functions have the same initial seed and boundary, they will return the same sequence of numbers.

UUID()

Returns a universally unique identifier (UUID) string based on RFC 4122 type 4 (pseudo-random generated).

For example, 3d3c68f7-f608-473f-b60c-b0c44ad4cc4e is generated using a cryptographically strong pseudo-random number generator.

BIN(INT)

Returns the string representation of INTEGER in binary format. If INTEGER is NULL, returns NULL.

For example, 4.bin() returns "100", and 12.bin() returns "1100".

HEX(numeric)

HEX(string)

Returns the string representation of the numeric value or STRING in hexadecimal format. If the parameter is NULL, returns NULL.

For example, the number 20 returns "14", the number 100 returns "64", and the string "hello,world" returns "68656C6C6F2C776F726C64".

TRUNCATE(numeric1, integer2)

Returns the number with integer2 decimal places truncated. If numeric1 or integer2 is NULL, returns NULL.

If integer2 is 0, the result has no decimal point or decimal part. integer2 can be negative, making the integer2 digits to the left of the decimal point zero.

This function can also be called with only one numeric1 parameter and without setting integer2.

If integer2 is not set, it defaults to 0. For example, 42.324.truncate(2) is 42.32, and 42.324.truncate() is 42.0.

We use cookies to improve our site and your experience. By continuing to browse our site you accept our cookie policy. Find out more

Feedback

Feedback

Feedback

0/500

Selected Content

Submit selected content with the feedback