Oracle 5.0 Reference Manual page 926

Table of Contents

Advertisement

These rules are applied for each operation, such that nested calculations imply the precision of each
component. Hence,
(14620 / 9432456) / (24250 /
(0.0026), with the final result having 8 decimal places (0.60288653).
Because of these rules and the way they are applied, care should be taken to ensure that components
and subcomponents of a calculation use the appropriate level of precision. See
Functions and
Operators".
For information about handling of overflow in numeric expression evaluation, see
"Out-of-Range and Overflow
Arithmetic operators apply to numbers. For other types of values, alternative operations may be
available. For example, to add date values, use
Time
Functions".
[906]
+
Addition:
mysql>
SELECT 3+5;
-> 8
[906]
-
Subtraction:
mysql>
SELECT 3-5;
-> -2
[906]
-
Unary minus. This operator changes the sign of the operand.
mysql>
SELECT - 2;
-> -2
Note
If this operator is used with a BIGINT, the return value is also a BIGINT. This
means that you should avoid using
2
[906]
*
Multiplication:
mysql>
SELECT 3*5;
-> 15
mysql>
SELECT 18014398509481984*18014398509481984.0;
-> 324518553658426726783156020576256.0
[906]
/
Division:
mysql>
SELECT 3/5;
-> 0.60
Division by zero produces a
mysql>
SELECT 102/(1-1);
-> NULL
A division is calculated with
converted to an integer.
Arithmetic Operators
Handling".
63
.
result:
NULL
arithmetic only if performed in a context where its result is
BIGINT
906
9432456), resolves first to
[919]; see
DATE_ADD()
on integers that may have the value of –
-
(0.0014) /
Section 12.10, "Cast
Section 11.1.4.6,
Section 12.7, "Date and

Advertisement

Table of Contents
loading

This manual is also suitable for:

Mysql 5.0

Table of Contents