Contact Us 1-800-596-4880

Math (dw::util::Math)

A utility module that provides mathematical functions.

To use this module, you must import it to your DataWeave code, for example, by adding the line import * from dw::util::Math to the header of your DataWeave script.

Introduced in DataWeave version 2.4.0.

Functions

Name Description

acos

Returns an arc cosine value that can range from 0.0 through pi.

asin

Returns an arc sine value that can range from -pi/2 through pi/2.

atan

Returns an arc tangent value that can range from -pi/2 through pi/2.

cos

Returns the trigonometric cosine of an angle from a given number of radians.

decimalAdd

Performs number addition with rounding specified by the operation context.

decimalDivide

Performs number division with rounding specified by the operation context. If precision is set to 0 (unlimited precision) and the result has an infinite decimal expansion, the function returns an error.

decimalMultiply

Performs number multiplication with rounding specified by the operation context.

decimalPow

Returns a number with value base^exponent with rounding specified by the operation context. The maximum value for exponent is 99999999.

decimalRound

Returns the argument number with rounding specified by the operation context.

decimalSqrt

Returns a number that approximates the square root of the argument with rounding specified by the operation context.

decimalSubtract

Performs number subtraction with rounding specified by the operation context.

log10

Returns the logarithm base 10 of a number.

logn

Returns the natural logarithm (base e) of a number.

sin

Returns the trigonometric sine of an angle from a given number of radians.

tan

Returns the trigonometric tangent of an angle from a given number of radians.

toDegrees

Converts an angle measured in radians to an approximately equivalent number of degrees.

toRadians

Converts a given number of degrees in an angle to an approximately equivalent number of radians.

Variables

Types