OceanBase logo

OceanBase

A unified distributed database ready for your transactional, analytical, and AI workloads.

Product Overview
DEPLOY YOUR WAY

OceanBase Cloud

The best way to deploy and scale OceanBase

OceanBase Enterprise

Run and manage OceanBase on your infra

TRY OPEN SOURCE

OceanBase Community Edition

The free, open-source distributed database

OceanBase seekdb

Open source AI native search database

Customer Stories

Real-world success stories from enterprises across diverse industries.

View All
BY USE CASES

Mission-Critical Transactions

Global & Multicloud Application

Elastic Scaling for Peak Traffic

Real-time Analytics

Active Geo-redundancy

Database Consolidation

Resources

Comprehensive knowledge hub for OceanBase.

Blog

Live Demos

Training & Certification

Documentation

Official technical guides, tutorials, API references, and manuals for all OceanBase products.

View All
PRODUCTS

OceanBase Cloud

OceanBase Database

Tools

Connectors and Middleware

QUICK START

OceanBase Cloud

OceanBase Database

BEST PRACTICES

Practical guides for utilizing OceanBase more effectively and conveniently

Company

Learn more about OceanBase – our company, partnerships, and trust and security initiatives.

About OceanBase

Partner

Trust Center

Contact Us

International - English
中国站 - 简体中文
日本 - 日本語
Sign In
Start on Cloud

OceanBase

A unified distributed database ready for your transactional, analytical, and AI workloads.

Product Overview
DEPLOY YOUR WAY

OceanBase Cloud

The best way to deploy and scale OceanBase

OceanBase Enterprise

Run and manage OceanBase on your infra

TRY OPEN SOURCE

OceanBase Community Edition

The free, open-source distributed database

OceanBase seekdb

Open source AI native search database

Customer Stories

Real-world success stories from enterprises across diverse industries.

View All
BY USE CASES

Mission-Critical Transactions

Global & Multicloud Application

Elastic Scaling for Peak Traffic

Real-time Analytics

Active Geo-redundancy

Database Consolidation

Comprehensive knowledge hub for OceanBase.

Blog

Live Demos

Training & Certification

Documentation

Official technical guides, tutorials, API references, and manuals for all OceanBase products.

View All
PRODUCTS
OceanBase CloudOceanBase Database
ToolsConnectors and Middleware
QUICK START
OceanBase CloudOceanBase Database
BEST PRACTICES

Practical guides for utilizing OceanBase more effectively and conveniently

Learn more about OceanBase – our company, partnerships, and trust and security initiatives.

About OceanBase

Partner

Trust Center

Contact Us

Start on Cloud
编组
All Products
    • Databases
    • iconOceanBase Database
    • iconOceanBase Cloud
    • iconOceanBase Tugraph
    • iconInteractive Tutorials
    • iconOceanBase Best Practices
    • Tools
    • iconOceanBase Cloud Platform
    • iconOceanBase Migration Service
    • iconOceanBase Developer Center
    • iconOceanBase Migration Assessment
    • iconOceanBase Admin Tool
    • iconOceanBase Loader and Dumper
    • iconOceanBase Deployer
    • iconKubernetes operator for OceanBase
    • iconOceanBase Diagnostic Tool
    • iconOceanBase Binlog Service
    • Connectors and Middleware
    • iconOceanBase Database Proxy
    • iconEmbedded SQL in C for OceanBase
    • iconOceanBase Call Interface
    • iconOceanBase Connector/C
    • iconOceanBase Connector/J
    • iconOceanBase Connector/ODBC
    • iconOceanBase Connector/NET
icon

OceanBase Call Interface

V2.1.0Enterprise Edition

  • What's New
  • Product Introduction
  • Install OBCI
  • Data types
  • Basic development procedure
  • Development example
  • Load balancing
  • Reference Functions
    • Connect, authorize, and initialize functions
    • Handle and descriptor functions
    • Bind, define, and describe functions
    • Statement functions
    • LOB functions
    • Transaction functions
    • Miscellaneous functions
    • String functions
    • Date and Datetime functions
    • Interval functions
    • Number functions
    • Terminate functions
    • Describe functions
    • Locale functions
    • Define functions
  • Full-link Diagnostic Trace
    • Full-link Diagnostic Trace
    • Full-link Diagnostic Trace of OBCI
    • Sample code

Download PDF

What's New Product Introduction Install OBCI Data types Basic development procedure Development example Load balancing Connect, authorize, and initialize functions Handle and descriptor functions Bind, define, and describe functions Statement functions LOB functions Transaction functions Miscellaneous functions String functions Date and Datetime functions Interval functions Number functions Terminate functions Describe functions Locale functions Define functions Full-link Diagnostic Trace Full-link Diagnostic Trace of OBCI Sample code
OceanBase logo

The Unified Distributed Database for the AI Era.

Follow Us
Products
OceanBase CloudOceanBase EnterpriseOceanBase Community EditionOceanBase seekdb
Resources
DocsBlogLive DemosTraining & Certification
Company
About OceanBaseTrust CenterLegalPartnerContact Us
Follow Us

© OceanBase 2026. All rights reserved

Cloud Service AgreementPrivacy PolicySecurity
Contact Us
Document Feedback
  1. Documentation Center
  2. OceanBase Call Interface
  3. V2.1.0
iconOceanBase Call Interface
V 2.1.0Enterprise Edition

Number functions

Last Updated:2024-05-14 09:02:08  Updated
share
What is on this page
OCINumberToInt
OCINumberToReal
OCINumberToText
OCINumberIsInt
OCINumberFromText
OCINumberAbs
OCINumberAdd
OCINumberArcCos
OCINumberArcSin
OCINumberArcTan
OCINumberAssign
OCINumberCeil
OCINumberCmp
Additional information
OCINumberCos
OCINumberDec
OCINumberDiv
OCINumberExp
OCINumberFloor
OCINumberFromInt
OCINumberFromReal
OCINumberHypCos
OCINumberHypSin
OCINumberHypTan
OCINumberInc
OCINumberIsZero
OCINumberLn
OCINumberLog
OCINumberMod
OCINumberMul
OCINumberNeg
OCINumberPrec
OCINumberRound
OCINumberSetPi
OCINumberSetZero
OCINumberShift
OCINumberSign
Additional information
OCINumberSin
OCINumberSqrt
OCINumberSub
OCINumberTan
OCINumberToRealArray
OCINumberTrunc

folded

share

OCINumberToInt

Purpose : You can call this function to convert an Oracle NUMBER to an integer.

Syntax :

sword OCINumberToInt ( 
OCIError              *err,
const OCINumber       *number,
uword                 rsl_length,
uword                 rsl_flag,
void                  *rsl );

Parameters :

Parameter Description
err(IN/OUT) The error handle.
number(IN) The number to be converted.
rsl_length(IN) The size of the rsl parameter.
rsl_flag(IN) The flag that designates the sign of the output. Valid values: OCI_NUMBER_UNSIGNED OCI_NUMBER_SIGNED
rsl(OUT) The pointer to the result space.

Return value : OCI_SUCCESS is returned if the function call succeeded, and OCI_ERROR is returned if the function call failed.

OCINumberToReal

Purpose : You can call this function to convert an Oracle NUMBER to a real number.

Syntax :

sword OCINumberToReal ( 
OCIError            *err,
const OCINumber     *number,
uword               rsl_length,
void                *rsl );

Parameters :

Parameter Description
err(IN/OUT) The error handle.
number(IN) The number to be converted.
rsl_length(IN) The size of the desired result. The value equals sizeof({ float | double | long double}).
rsl(OUT) The pointer to the result space.

Return value : OCI_SUCCESS is returned if the function call succeeded, and OCI_ERROR is returned if the function call failed.

OCINumberToText

Purpose : You can call this function to convert an Oracle NUMBER to a string in the specified format.

Syntax :

sword OCINumberToText ( 
OCIError             *err,
const OCINumber      *number,
const OraText        *fmt,
ub4                  fmt_length,
const OraText        *nls_params,
ub4                  nls_p_length,
ub4                  *buf_size,
OraText              *buf );

Parameters :

Parameter Description
err(IN/OUT) The error handle.
number(IN) The number to be converted.
fmt(IN) The conversion format.
fmt_length(IN) The length of the format.
nls_params(IN) Default parameters of the session are used if it is a NULL string or ((text *) 0).
nls_p_length(IN) The length of nls_params.
buf_size(IN) The size of the buffer.
buf(OUT) The buffer where the converted string is placed.

Return value : OCI_SUCCESS is returned if the function call succeeded, and OCI_ERROR is returned if the function call failed.

OCINumberIsInt

Purpose : You can call this function to test whether the OCINumber value is an integer.

Syntax :

sword OCINumberIsInt ( 
OCIError         *err,
const OCINumber  *number,
boolean          *result );

Parameters :

Parameter Description
err(IN/OUT) The error handle.
number(IN) The number to be tested.
result(OUT) Returns TRUE if the result is an integer, or FALSE if otherwise.

Return value : OCI_SUCCESS is returned if the function call succeeded, and OCI_ERROR is returned if the function call failed.

OCINumberFromText

Purpose : You can call this function to convert a string to an Oracle NUMBER.

Syntax :

sword OCINumberFromText ( 
OCIError           *err,
const OraText      *str,
ub4                str_length,
const OraText      *fmt,
ub4                fmt_length,
const OraText      *nls_params,
ub4                nls_p_length,
OCINumber          *number );

Parameters :

Parameter Description
err(IN/OUT) The error handle.
str(IN) The input string to be converted to an Oracle NUMBER.
str_length(IN) The size of the input string.
fmt(IN) The conversion format.
fmt_length(IN) The length of the format.
nls_params(IN) Default parameters of the session are used if it is a NULL string ("").
nls_p_length(IN) The length of nls_params.
number(OUT) The converted number.

Return value : OCI_SUCCESS is returned if the function call succeeded, and OCI_ERROR is returned if the function call failed.

OCINumberAbs

Purpose : You can call this function to calculate the absolute value of an Oracle NUMBER.

Syntax :

sword OCINumberAbs ( OCIError              *err,
const OCINumber       *number, 
OCINumber             *result );

Parameters :

Parameter Description
err (IN/OUT) The error handle. If any error occurs, it is recorded in err, and the function returns OCI_ERROR. You can call OCIErrorGet to obtain the diagnostic information.
number (IN) The input Oracle NUMBER.
result (OUT) The absolute value of the input Oracle NUMBER.

Return value : OCI_SUCCESS is returned if the function call succeeded, and OCI_ERROR is returned if the function call failed.

OCINumberAdd

Purpose : You can call this function to add one Oracle NUMBER to another Oracle NUMBER.

Syntax :

sword OCINumberAdd ( OCIError              *err,
const OCINumber       *number1, 
const OCINumber       *number2,
OCINumber             *result );

Parameters :

Parameter Description
err (IN/OUT) The error handle. If any error occurs, it is recorded in err, and the function returns OCI_ERROR. You can call OCIErrorGet to obtain the diagnostic information.
number1, number2 (IN) Adds number1 to number2.
result (OUT) The result of adding number1 to number2.

Return value : OCI_SUCCESS is returned if the function call succeeded, and OCI_ERROR is returned if the function call failed.

OCINumberArcCos

Purpose : You can call this function to obtain the arccosine of an Oracle NUMBER in radians.

Syntax :

sword OCINumberArcCos ( OCIError            *err, 
const OCINumber     *number, 
OCINumber           *result );

Parameters :

Parameter Description
err (IN/OUT) The error handle. If any error occurs, it is recorded in err, and the function returns OCI_ERROR. You can call OCIErrorGet to obtain the diagnostic information.
number (IN) The arccosine parameter.
result (OUT) The arccosine result in radians.

Return value : OCI_SUCCESS is returned if the function call succeeded, and OCI_ERROR is returned if the function call failed.

OCINumberArcSin

Purpose : You can call this function to obtain the arcsine of an Oracle NUMBER in radians.

Syntax :

sword OCINumberArcSin ( OCIError              *err,
const OCINumber       *number, 
OCINumber             *result );

Parameters :

Parameter Description
err (IN/OUT) The error handle. If any error occurs, it is recorded in err, and the function returns OCI_ERROR. You can call OCIErrorGet to obtain the diagnostic information.
number (IN) The arcsine parameter.
result (OUT) The arcsine result in radians.

Return value : OCI_SUCCESS is returned if the function call succeeded, and OCI_ERROR is returned if the function call failed.

OCINumberArcTan

Purpose : You can call this function to obtain the arctangent of an Oracle NUMBER in radians.

Syntax :

sword OCINumberArcTan ( OCIError             *err, 
const OCINumber      *number, 
OCINumber            *result );

Parameters :

Parameter Description
err (IN/OUT) The error handle. If any error occurs, it is recorded in err, and the function returns OCI_ERROR. You can call OCIErrorGet to obtain the diagnostic information.
number (IN) The arctangent parameter.
result (OUT) The arctangent result in radians.

Return value : OCI_SUCCESS is returned if the function call succeeded, and OCI_ERROR is returned if the function call failed.

OCINumberAssign

Purpose : You can call this function to assign one Oracle NUMBER to another Oracle NUMBER.

Syntax :

sword OCINumberAssign ( OCIError              *err,
const OCINumber       *from, 
OCINumber             *to );

Parameters :

Parameter Description
err (IN/OUT) The error handle. If any error occurs, it is recorded in err, and the function returns OCI_ERROR. You can call OCIErrorGet to obtain the diagnostic information.
from (IN) The NUMBER to be assigned.
to (OUT) The target NUMBER to which the number is assigned.

Return value : OCI_SUCCESS is returned if the function call succeeded, and OCI_ERROR is returned if the function call failed.

OCINumberCeil

Purpose : You can call this function to calculate the ceiling value of an Oracle NUMBER.

Syntax :

sword OCINumberCeil ( OCIError              *err, 
const OCINumber       *number, 
OCINumber             *result );

Parameters :

Parameter Description
err (IN/OUT) The error handle. If any error occurs, it is recorded in err, and the function returns OCI_ERROR. You can call OCIErrorGet to obtain the diagnostic information.
number (IN) The input Oracle NUMBER.
result (OUT) The ceiling value of the input Oracle NUMBER.

Return value : OCI_SUCCESS is returned if the function call succeeded, and OCI_ERROR is returned if the function call failed.

OCINumberCmp

Purpose : You can call this function to compare one Oracle NUMBER with another Oracle NUMBER.

Syntax :

sword OCINumberCmp ( OCIError            *err,
const OCINumber     *number1, 
const OCINumber     *number2,
sword               *result );

Parameters :

Parameter Description
err (IN/OUT) The error handle. If any error occurs, it is recorded in err, and the function returns OCI_ERROR. You can call OCIErrorGet to obtain the diagnostic information.
number1, number2 (IN) Compares number1 with number2.
result (OUT) The comparison result. For more information, see the table in the Additional information section.

Return value : OCI_SUCCESS is returned if the function call succeeded, and OCI_ERROR is returned if the function call failed.

Additional information

Comparison result Output
number1<number2 negative
number1=number2 0
number1>number2 positive

OCINumberCos

Purpose : You can call this function to calculate the cosine of an Oracle NUMBER in radians.

Syntax :

sword OCINumberCos ( OCIError              *err,
const OCINumber       *number, 
OCINumber             *result );

Parameters :

Parameter Description
err (IN/OUT) The error handle. If any error occurs, it is recorded in err, and the function returns OCI_ERROR. You can call OCIErrorGet to obtain the diagnostic information.
number (IN) The cosine parameter in radians.
result (OUT) The cosine value.

Return value : OCI_SUCCESS is returned if the function call succeeded, and OCI_ERROR is returned if the function call failed.

OCINumberDec

Purpose : You can call this function to progressively decrement an Oracle NUMBER within a specific range.

Syntax :

sword OCINumberDec ( OCIError  *err, 
OCINumber *number );

Parameters :

Parameter Description
err (IN/OUT) The error handle. If any error occurs, it is recorded in err, and the function returns OCI_ERROR. You can call OCIErrorGet to obtain the diagnostic information.
number (IN/OUT) The positive Oracle NUMBER to be progressively decremented.

Return value : OCI_SUCCESS is returned if the function call succeeded, and OCI_ERROR is returned if the function call failed.

OCINumberDiv

Purpose : You can call this function to divide one Oracle NUMBER by another Oracle NUMBER.

Syntax :

sword OCINumberDiv ( OCIError               *err,
const OCINumber        *number1, 
const OCINumber        *number2,
OCINumber              *result );

Parameters :

Parameter Description
err (IN/OUT) The error handle. If any error occurs, it is recorded in err, and the function returns OCI_ERROR. You can call OCIErrorGet to obtain the diagnostic information.
number1 (IN) The pointer to the numerator.
number2 (IN) The pointer to the denominator.
result (OUT) The division result.

Return value : OCI_SUCCESS is returned if the function call succeeded, and OCI_ERROR is returned if the function call failed.

OCINumberExp

Purpose : You can call this function to transfer e as a power series to an Oracle NUMBER.

Syntax :

sword OCINumberExp ( OCIError              *err, 
const OCINumber       *number,
OCINumber             *result );

Parameters :

Parameter Description
err (IN/OUT) The error handle. If any error occurs, it is recorded in err, and the function returns OCI_ERROR. You can call OCIErrorGet to obtain the diagnostic information.
number (IN) The Oracle NUMBER to which e is transferred.
result (OUT) The result of the exponentiation.

Return value : OCI_SUCCESS is returned if the function call succeeded, and OCI_ERROR is returned if the function call failed.

OCINumberFloor

Purpose : You can call this function to calculate the rounded-down floor value of an Oracle NUMBER.

Syntax :

sword OCINumberFloor ( OCIError              *err,
const OCINumber       *number, 
OCINumber             *result );

Parameters :

Parameter Description
err (IN/OUT) The error handle. If any error occurs, it is recorded in err, and the function returns OCI_ERROR. You can call OCIErrorGet to obtain the diagnostic information.
number (IN) The input Oracle NUMBER.
result (OUT) The rounded-down floor value of the Oracle NUMBER.

Return value : OCI_SUCCESS is returned if the function call succeeded, and OCI_ERROR is returned if the function call failed.

OCINumberFromInt

Purpose : You can call this function to convert an integer to an Oracle NUMBER.

Syntax :

sword OCINumberFromInt ( OCIError            *err,
const void          *inum, 
uword               inum_length,
uword               inum_s_flag,
OCINumber           *number );

Parameters :

Parameter Description
err (IN/OUT) The error handle. If any error occurs, it is recorded in err, and the function returns OCI_ERROR. You can call OCIErrorGet to obtain the diagnostic information.
inum (IN) The pointer to the integer to be converted.
inum_length (IN) The length of the integer.
inum_s_flag (IN) The flag that designates the sign of the integer. Valid values: * OCI_NUMBER_UNSIGNED: indicates an unsigned value. * OCI_NUMBER_SIGNED: indicates a signed value.
number (OUT) The Oracle NUMBER to which the given integer is converted.

Return value : OCI_SUCCESS is returned if the function call succeeded, and OCI_ERROR is returned if the function call failed.

OCINumberFromReal

Purpose : You can call this function to convert a floating-point real number to an Oracle NUMBER.

Syntax :

sword OCINumberFromReal ( OCIError           *err,
const void         *rnum,
uword              rnum_length,
OCINumber          *number );

Parameters :

Parameter Description
err (IN/OUT) The error handle. If any error occurs, it is recorded in err, and the function returns OCI_ERROR. You can call OCIErrorGet to obtain the diagnostic information.
rnum (IN) The pointer to the floating-point number to be converted.
rnum_length (IN) The size of the desired result. The value equals sizeof({ float | double | long double}).
number (OUT) The Oracle NUMBER to which the given floating-point number is converted.

Return value : OCI_SUCCESS is returned if the function call succeeded, and OCI_ERROR is returned if the function call failed.

OCINumberHypCos

Purpose : You can call this function to calculate the hyperbolic cosine of an Oracle NUMBER.

Syntax :

sword OCINumberHypCos ( OCIError              *err, 
const OCINumber       *number, 
OCINumber             *result );

Parameters :

Parameter Description
err (IN/OUT) The error handle. If any error occurs, it is recorded in err, and the function returns OCI_ERROR. You can call OCIErrorGet to obtain the diagnostic information.
number (IN) The cosine hyperbolic parameter.
result (OUT) The cosine hyperbolic value.

Return value : OCI_SUCCESS is returned if the function call succeeded, and OCI_ERROR is returned if the function call failed.

OCINumberHypSin

Purpose : You can call this function to calculate the hyperbolic sine of an Oracle NUMBER.

Syntax :

sword OCINumberHypSin ( OCIError              *err,
const OCINumber       *number, 
OCINumber             *result );

Parameters :

Parameter Description
err (IN/OUT) The error handle. If any error occurs, it is recorded in err, and the function returns OCI_ERROR. You can call OCIErrorGet to obtain the diagnostic information.
number (IN) The hyperbolic sine parameter.
result (OUT) The hyperbolic sine.

Return value : OCI_SUCCESS is returned if the function call succeeded, and OCI_ERROR is returned if the function call failed.

OCINumberHypTan

Purpose : You can call this function to calculate the hyperbolic tangent of an Oracle NUMBER.

Syntax :

sword OCINumberHypTan ( OCIError              *err,
const OCINumber       *number,
OCINumber             *result );

Parameters :

Parameter Description
err (IN/OUT) The error handle. If any error occurs, it is recorded in err, and the function returns OCI_ERROR. You can call OCIErrorGet to obtain the diagnostic information.
number (IN) The hyperbolic tangent parameter.
result (OUT) The hyperbolic tangent.

Return value : OCI_SUCCESS is returned if the function call succeeded, and OCI_ERROR is returned if the function call failed.

OCINumberInc

Purpose : You can call this function to progressively increment an Oracle NUMBER.

Syntax :

sword OCINumberInc ( OCIError   *err, 
OCINumber  *number );

Parameters :

Parameter Description
err (IN/OUT) The error handle. If any error occurs, it is recorded in err, and the function returns OCI_ERROR. You can call OCIErrorGet to obtain the diagnostic information.
number (IN/OUT) The positive Oracle NUMBER to be progressively incremented.

Return value : OCI_SUCCESS is returned if the function call succeeded, and OCI_ERROR is returned if the function call failed.

OCINumberIsZero

Purpose : You can call this function to test whether a given NUMBER is zero.

Syntax :

sword OCINumberIsZero ( OCIError            *err,
const OCINumber     *number,
boolean             *result );

Parameters :

Parameter Description
err (IN/OUT) The error handle. If any error occurs, it is recorded in err, and the function returns OCI_ERROR. You can call OCIErrorGet to obtain the diagnostic information.
number (IN) The NUMBER to be tested.
result (OUT) Returns TRUE if the Oracle NUMBER is 0, and FALSE if otherwise.

Return value : OCI_SUCCESS is returned if the function call succeeded, and OCI_ERROR is returned if the function call failed.

OCINumberLn

Purpose : You can call this function to calculate the natural logarithm (with e as the base) of an Oracle NUMBER.

Syntax :

sword OCINumberLn ( OCIError              *err,
const OCINumber       *number,
OCINumber             *result );

Parameters :

Parameter Description
err (IN/OUT) The error handle. If any error occurs, it is recorded in err, and the function returns OCI_ERROR. You can call OCIErrorGet to obtain the diagnostic information.
number (IN) The Oracle NUMBER whose logarithm is to be calculated.
result (OUT) The logarithm result.

Return value : OCI_SUCCESS is returned if the function call succeeded, and OCI_ERROR is returned if the function call failed.

OCINumberLog

Purpose : You can call this function to calculate the logarithm (with any value as the base) of an Oracle NUMBER.

Syntax :

sword OCINumberLog ( OCIError              *err, 
const OCINumber       *base, 
const OCINumber       *number, 
OCINumber             *result );

Parameters :

Parameter Description
err (IN/OUT) The error handle. If any error occurs, it is recorded in err, and the function returns OCI_ERROR. You can call OCIErrorGet to obtain the diagnostic information.
base (IN) The base of the logarithm.
number (IN) The operand.
result (OUT) The logarithm result.

Return value : OCI_SUCCESS is returned if the function call succeeded, and OCI_ERROR is returned if the function call failed.

OCINumberMod

Purpose : You can call this function to obtain the modulus (remainder) obtained by dividing one Oracle NUMBER by another.

Syntax :

sword OCINumberMod ( OCIError              *err,
const OCINumber       *number1, 
const OCINumber       *number2,
OCINumber             *result );

Parameters :

Parameter Description
err (IN/OUT) The error handle. If any error occurs, it is recorded in err, and the function returns OCI_ERROR. You can call OCIErrorGet to obtain the diagnostic information.
number1 (IN) The pointer to the numerator.
number2 (IN) The pointer to the denominator.
result (OUT) The remainder of the division.

Return value : OCI_SUCCESS is returned if the function call succeeded, and OCI_ERROR is returned if the function call failed.

OCINumberMul

Purpose : You can call this function to multiply one Oracle NUMBER by another Oracle NUMBER.

Syntax :

sword OCINumberMul ( OCIError              *err,
const OCINumber       *number1, 
const OCINumber       *number2,
OCINumber             *result );

Parameters :

Parameter Description
err (IN/OUT) The error handle. If any error occurs, it is recorded in err, and the function returns OCI_ERROR. You can call OCIErrorGet to obtain the diagnostic information.
number1 (IN) An Oracle NUMBER to be multiplied.
number2 (IN) An Oracle NUMBER to be multiplied.
result (OUT) The result of the multiplication.

Return value : OCI_SUCCESS is returned if the function call succeeded, and OCI_ERROR is returned if the function call failed.

OCINumberNeg

Purpose : You can call this function to negate an Oracle NUMBER.

Syntax :

sword OCINumberNeg ( OCIError              *err, 
const OCINumber       *number, 
OCINumber             *result );

Parameters :

Parameter Description
err (IN/OUT) The error handle. If any error occurs, it is recorded in err, and the function returns OCI_ERROR. You can call OCIErrorGet to obtain the diagnostic information.
number (IN) The Oracle NUMBER to be negated.
result (OUT) The negated value of the Oracle NUMBER.

Return value : OCI_SUCCESS is returned if the function call succeeded, and OCI_ERROR is returned if the function call failed.

OCINumberPrec

Purpose : You can call this function to round an OCINumber to the specified number of decimal places.

Syntax :

sword OCINumberPrec ( OCIError              *err, 
const OCINumber       *number,
eword                 nDigs, 
OCINumber             *result );

Parameters :

Parameter Description
err (IN/OUT) The error handle. If any error occurs, it is recorded in err, and the function returns OCI_ERROR. You can call OCIErrorGet to obtain the diagnostic information.
number (IN) The number for which the precision is set.
nDigs (IN) The number of decimal places in the result.
result (OUT) The result obtained after the rounding operation.

Return value : OCI_SUCCESS is returned if the function call succeeded, and OCI_ERROR is returned if the function call failed.

OCINumberRound

Purpose : You can call this function to round an Oracle NUMBER to the specified decimal place.

Syntax :

sword OCINumberRound ( OCIError              *err,
const OCINumber       *number,
sword                 decplace,
OCINumber             *result );

Parameters :

Parameter Description
err (IN/OUT) The error handle. If any error occurs, it is recorded in err, and the function returns OCI_ERROR. You can call OCIErrorGet to obtain the diagnostic information.
number (IN) The Oracle NUMBER to be rounded.
decplace (IN) The target decimal digit to which the Oracle NUMBER is to be rounded. Negative values are allowed.
result (OUT) The result obtained after the rounding operation.

Return value : OCI_SUCCESS is returned if the function call succeeded, and OCI_ERROR is returned if the function call failed.

OCINumberSetPi

Purpose : You can call this function to set an OCINumber to pi.

Syntax :

void OCINumberSetPi ( OCIError *err, 
OCINumber *num );

Parameters :

Parameter Description
err (IN/OUT) The error handle. If any error occurs, it is recorded in err, and the function returns OCI_ERROR. You can call OCIErrorGet to obtain the diagnostic information.
num (OUT) The Oracle NUMBER to be set to pi.

Return value : OCI_SUCCESS is returned if the function call succeeded, and OCI_ERROR is returned if the function call failed.

OCINumberSetZero

Purpose : You can call this function to initialize an Oracle NUMBER to zero.

Syntax :

void OCINumberSetZero (OCIError *err
OCINumber *num );

Parameters :

Parameter Description
err (IN/OUT) The error handle. Error check is not performed for this function because it never generates errors.
num (OUT) The Oracle NUMBER to be initialized to zero.

Return value : OCI_SUCCESS is returned if the function call succeeded, and OCI_ERROR is returned if the function call failed.

OCINumberShift

Purpose : You can call this function to multiply a NUMBER by a power of 10 by moving the decimal point a specified number of decimal places.

Syntax :

sword OCINumberShift ( OCIError         *err, 
const OCINumber  *number,
const sword      nDig,
OCINumber        *result );

Parameters :

Parameter Description
err (IN/OUT) The error handle. If any error occurs, it is recorded in err, and the function returns OCI_ERROR. You can call OCIErrorGet to obtain the diagnostic information.
number (IN) The Oracle NUMBER whose decimal digits are to be moved.
nDig (IN) The number of decimal places that the decimal point is to be moved.
result (OUT) The result of the movement.

Return value : OCI_SUCCESS is returned if the function call succeeded, and OCI_ERROR is returned if the function call failed.

OCINumberSign

Purpose : You can call this function to obtain the sign of an Oracle NUMBER.

Syntax :

sword OCINumberSign ( OCIError             *err, 
const OCINumber      *number, 
sword                *result );

Parameters :

Parameter Description
err (IN/OUT) The error handle. If any error occurs, it is recorded in err, and the function returns OCI_ERROR. You can call OCIErrorGet to obtain the diagnostic information.
number (IN) The Oracle NUMBER whose sign is to be returned.
result (OUT) The return value. For more information, see the table in the Additional information section.

Return value : OCI_SUCCESS is returned if the function call succeeded, and OCI_ERROR is returned if the function call failed.

Additional information

Value Return result
number < 0 -1
number == 0 0
number > 0 1

OCINumberSin

Purpose : You can call this function to calculate the sine of an Oracle NUMBER in radians.

Syntax :

sword OCINumberSin ( OCIError              *err, 
const OCINumber       *number, 
OCINumber             *result );

Parameters :

Parameter Description
err (IN/OUT) The error handle. If any error occurs, it is recorded in err, and the function returns OCI_ERROR. You can call OCIErrorGet to obtain the diagnostic information.
number (IN) The sine parameter in radians.
result (OUT) The sine.

Return value : OCI_SUCCESS is returned if the function call succeeded, and OCI_ERROR is returned if the function call failed.

OCINumberSqrt

Purpose : You can call this function to calculate the square root of an Oracle NUMBER.

Syntax :

sword OCINumberSqrt ( OCIError           *err,
const OCINumber     *number, 
OCINumber          *result );

Parameters :

Parameter Description
err (IN/OUT) The error handle. If any error occurs, it is recorded in err, and the function returns OCI_ERROR. You can call OCIErrorGet to obtain the diagnostic information.
number (IN) The input Oracle NUMBER.
result (OUT) The square root of the input Oracle NUMBER.

Return value : OCI_SUCCESS is returned if the function call succeeded, and OCI_ERROR is returned if the function call failed.

OCINumberSub

Purpose : You can call this function to subtract one Oracle NUMBER from another Oracle NUMBER.

Syntax :

sword OCINumberSub ( OCIError             *err,
const OCINumber      *number1, 
const OCINumber      *number2, 
OCINumber            *result );

Parameters :

Parameter Description
err (IN/OUT) The error handle. If any error occurs, it is recorded in err, and the function returns OCI_ERROR. You can call OCIErrorGet to obtain the diagnostic information.
number1, number2 (IN) Subtracts number2 from number1.
result (OUT) The result of the subtraction.

Return value : OCI_SUCCESS is returned if the function call succeeded, and OCI_ERROR is returned if the function call failed.

OCINumberTan

Purpose : You can call this function to calculate the tangent of an Oracle NUMBER in radians.

Syntax :

sword OCINumberTan ( OCIError              *err, 
const OCINumber       *number,
OCINumber             *result );

Parameters :

Parameter Description
err (IN/OUT) The error handle. If any error occurs, it is recorded in err, and the function returns OCI_ERROR. You can call OCIErrorGet to obtain the diagnostic information.
number (IN) The tangent parameter in radians.
result (OUT) The tangent.

Return value : OCI_SUCCESS is returned if the function call succeeded, and OCI_ERROR is returned if the function call failed.

OCINumberToRealArray

Purpose : You can call this function to convert a NUMBER array into a real-number array.

Syntax :

sword OCINumberToRealArray ( OCIError         *err, 
const OCINumber  **number,
uword            elems, 
uword               rsl_length, 
void             *rsl );

Parameters :

Parameter Description
err (IN/OUT) The error handle. If any error occurs, it is recorded in err, and the function returns OCI_ERROR. You can call OCIErrorGet to obtain the diagnostic information.
number (IN) The pointer to the NUMBER array to be converted.
elems (IN) The maximum number of NUMBER pointers.
rsl_length (IN) The size of the desired result. The value equals sizeof({ float | double | long double}).
rsl (OUT) The pointer to the space array that stores the result.

Return value : OCI_SUCCESS is returned if the function call succeeded, and OCI_ERROR is returned if the function call failed.

OCINumberTrunc

Purpose : You can call this function to truncate an Oracle NUMBER at the specified decimal place.

Syntax :

sword OCINumberTrunc ( OCIError             *err,
const OCINumber      *number, 
sword                decplace,
OCINumber            *result );

Parameters :

Parameter Description
err (IN/OUT) The error handle. If any error occurs, it is recorded in err, and the function returns OCI_ERROR. You can call OCIErrorGet to obtain the diagnostic information.
number (IN) The input Oracle NUMBER.
decplace (IN) The number of decimal places to be retained on the right of the decimal point after truncation. Negative values are allowed.
result (OUT) The result of the truncation.

Return value : OCI_SUCCESS is returned if the function call succeeded, and OCI_ERROR is returned if the function call failed.

Previous topic

Interval functions
Last

Next topic

Terminate functions
Next
What is on this page
OCINumberToInt
OCINumberToReal
OCINumberToText
OCINumberIsInt
OCINumberFromText
OCINumberAbs
OCINumberAdd
OCINumberArcCos
OCINumberArcSin
OCINumberArcTan
OCINumberAssign
OCINumberCeil
OCINumberCmp
Additional information
OCINumberCos
OCINumberDec
OCINumberDiv
OCINumberExp
OCINumberFloor
OCINumberFromInt
OCINumberFromReal
OCINumberHypCos
OCINumberHypSin
OCINumberHypTan
OCINumberInc
OCINumberIsZero
OCINumberLn
OCINumberLog
OCINumberMod
OCINumberMul
OCINumberNeg
OCINumberPrec
OCINumberRound
OCINumberSetPi
OCINumberSetZero
OCINumberShift
OCINumberSign
Additional information
OCINumberSin
OCINumberSqrt
OCINumberSub
OCINumberTan
OCINumberToRealArray
OCINumberTrunc