Declarative Objectivity (DO) Language : Operator Expressions : Math Operators
Math Operators
Math operators provide support for mathematical calculations.  
Operator
Description
Usage
First Operand
(op1)
Second Operand
(op2)
Result Type 1
ABS
Absolute value of a number
ABS(op1)
Numeric
Numeric
ACOS
Arc cosine of a number
ACOS(op1)
Numeric
Real
ASIN
Arcsine of a number
ASIN(op1)
Numeric
Real
ATAN
Arctangent of a number
ATAN(op1)
Numeric
Real
ATAN2
Arctangent of a point specified by two coordinates
ATAN2(op1, op2)
Numeric
Numeric
Real
CEILING
Ceiling of a number
CEILING(op1)
Numeric
Integer
COS
Cosine of a number representing an angle given in radians
COS(op1)
Numeric
Real
EXP
e raised to a power
EXP(op1)
Numeric
Real
FLOOR
Floor of a number
FLOOR(op1)
Numeric
Integer
LOG
Logarithm of a number to base 10
LOG(op1)
Numeric
Real
PI
Mathematical value pi to 21 digits
PI()
Real
RAND
Random number greater than or equal to 0 and less than 1
RAND(op1)
Integer
Real
ROUND
A given number rounded up or down to the nearest whole number
ROUND(op1)
Numeric
Integer
SIGN
Sign of a given number; returns 1 if op1 is positive, 0 if op1 is 0, or -1 if op1 is negative.
SIGN(op1)
Numeric
Integer
SIN
Sine of a number representing an angle given in radians
SIN(op1)
Numeric
Real
SQRT
Square root of a number
SQRT(op1)
Numeric
Real
TAN
Tangent of a number representing an angle given in radians
TAN(op1)
 
Numeric
Real
TRUNCATE
Truncate a number at the decimal point
TRUNCATE(op1)
Numeric
Integer
1. The math operators return null if the operand is a null value
Quick Look 
Find the rental-company branch locations with rate factors that are between 3.0 and -3.0 inclusive:
FROM Location WHERE ABS(rateFactor) <= 3.0 RETURN name;
Find the circumference of Circle objects with a diameter attribute.
FROM Circle RETURN diameter * PI() as Circumference;
Discussion 
For general information about operator formats, operands, and precedence, see About Operator Expressions.