Entering content frame

Background documentation Mathematical Operators and Functions Locate the document in its SAP Library structure

Mathematical Operators

Operator

Explanation

(

Opening bracket

)

Closing bracket

*

Multiplication

**

Power (e.g. 2 * * 3 = 2 * 2 * 2)

+       

Addition

-

Subtraction

/

Division

;

Separator between arguments. An argument is an input parameter. For example, in function f, expressed as f(  X1 ;  X2  ), the arguments are X1 and X2.

<

Smaller than

<=

Smaller than or equal to

>

Larger than

>=

Larger than or equal to

Mathematical Functions

Refer to the following table to find the function of your choice. The functions are listed in alphabetical order.

Function

Explanation

ABS()

ABS( X ) returns the absolute value |X| for X. The argument can be either a number that you enter in an Operator/function dialog box or one of the macro elements cell, row or column from the planning table or auxiliary table.

ACOS()

Arccos( X ) where X is between –1 and 1, so that the function has values in the range [-p/2, p/2]. The argument can be either a number that you enter in an Operator/function dialog box, or one of the macro elements cell, row, or column from the planning table or the auxiliary table.

ASIN()

Arc sin( X ) where X is between –1 and 1, so that the function has values in the range [-p/2, p/2]. The argument can be either a number that you enter in an Operator/function dialog box, or one of the macro elements cell, row, or column from the planning table or the auxiliary table.

ATAN()

Arc tan( X ) has values in the range [-p/2, p/2]. The argument can be either a number that you enter in an Operator/function dialog box, or one of the macro elements cell, row, or column from the planning table or the auxiliary table.

BETWEEN

Operator: For example, X BETWEEN 0 AND 10 returns the value 1 if X falls within the range 0 through 10.

COS()

COS( X ) returns the cosine of an angle measured in radians. The argument can be either a number that you enter in an Operator/function dialog box, or one of the macro elements cell, row, or column from the planning table or the auxiliary table.

COSH()

COSH ( X ) returns the hyperbolic cosine. The argument can be either a number that you enter in an Operator/function dialog box, or one of the macro elements cell, row, or column from the planning table or the auxiliary table.

DIV

Whole number divisions (quotient) operator: For example, 6 DIV 4 returns 1.

EXP()

EXP( X ) is the exponential function. The argument can be either a number that you enter in an Operator/function dialog box, or one of the macro elements cell, row, or column from the planning table or the auxiliary table.

FAC()

FAC( n ) returns the factor of n, that is, the result of multiplying the integers from 1 through n, expressed as n!  If n = 3, then 3! = 3 * 2 * 1 =  6. The argument can be either a number that you enter in an Operator/function dialog box, or one of the macro elements cell, row, or column from the planning table or the auxiliary table.

FLOOR()

FLOOR( X ) returns the largest integer value that is not greater than X. The argument can be either a number that you enter in an Operator/function dialog box, or one of the macro elements cell, row or column from the planning table or the auxiliary table.

FRAC()

FRAC( X ) returns the decimal part of X. The argument can be either a number that you enter in an Operator/function dialog box, or one of the macro elements cell, row or column from the planning table or auxiliary table.

LOG()

LOG( X ) returns the natural logarithm of X. The argument can be either a number that you enter in an Operator/function dialog box, or one of the macro elements cell, row or column from the planning table or the auxiliary table.

LOG10()

LOG10( X ) returns the power to which the basis of 10 must be raised to get the number X. The argument can be either a number that you enter in an Operator/function dialog box, or one of the macro elements cell, row, or column from the planning table or the auxiliary table.

MOD

Operator for whole number divisions (remainder): For example, 6 MOD 4 returns 0.5.

PARTIALSUM()

PARTIALSUM( X ; Y1 ; ... ; Yn ) allows you to sum a variable number of values in a time series where X specifies the number of values and Y1 through Yn specify the time series.

ROUND()

ROUND( X ; Y ) rounds X to Y decimal places. The arguments can be numbers that you enter in Operator/function dialog boxes, as well as cell(s), row(s) or column(s) from the planning table or the auxiliary table.

SIGN()

SIGN( X ) returns

the value of  1     if      X > 0

the value of  0     if      X = 0

the value of -1     if      X < 0

The argument can be either a number that you enter in an Operator/function dialog box, or one of the macro elements cell, row or column from the planning table or the

auxiliary table.

SIN()

SIN( X ) returns the sine of angle X measured in radians. The argument can be either a number that you enter in an Operator/function dialog box, or one of the macro elements cell, row, or column from the planning table or the auxiliary table.

SQRT()

SQRT( X ) returns the square root of a non-negative number. The argument can be either a number that you enter in an Operator/function dialog box, or one of the macro elements cell, row, or column from the planning table or the auxiliary table.

SUM()

SUM ( X1 ; X2;... Xn ) returns the sum of the specified numbers.

TAN()

TAN( X ) returns the tangent of angle X measured in radians. The argument can be either a number that you enter in an Operator/function dialog box, or one of the macro elements cell, row, or column from the planning table or the auxiliary table.

TANH()

TANH( X ) returns the hyperbolic tangent of X. The argument can be either a number that you enter in an Operator/function dialog box, or one of the macro elements cell, row or column from the planning table or the auxiliary table.

TRUNC()

TRUNC( X ) returns the integer part of X. The argument can be either a number that you enter in an Operator/function dialog box, or one of the macro elements cell, row or column from the planning table or the auxiliary table.

Vector operators

Vector operators are operators whose operands are areas. Within the macro the operation is only performed once. Since the respective function module is only called once, performance is in general improved with respect to operators that have rows or cells as operands. The areas involved in such operations must be mutually compatible.

 

 

VEC_DIV()

VEC_DIV( area1 ; area2 ) carries out real division of the two areas. The ith member of area1 is divided by the ith member of area2.

VEC_MULT()

VEC_MULT(area1 ; area2 ) multiplies area1 by area2. The ith member of area1 is multiplies by the ith member of area2.

VEC_SUB()

VEC_SUB(area1 ; area2 ) subtracts area2 from area1. The ith member of area2 is subtracted from the ith member of area1.

VEC_SUM()

VEC_SUM(area1 ; area2 ) adds area2 to area1. The ith member of area2 is added to the ith member of area1

 

 

Leaving content frame