Skip to main content

sqrt (Function)

This function returns the square-root of the given value. It wraps the java.lang.Math.sqrt() function.

Syntax

<DOUBLE> math:sqrt(<INT|LONG|FLOAT|DOUBLE> p1)

Query Parameters

NameDescriptionDefault ValuePossible Data TypesOptionalDynamic
p1The value of the parameter whose square-root value should be found.INT LONG FLOAT DOUBLENoYes

Example 1

CREATE STREAM InValueStream (inValue double);

insert into OutMediationStream
select math:sqrt(inValue) as sqrtValue
from InValueStream;

The function calculates the square-root value of the inValue and directs the output to the output stream, OutMediationStream. For example, sqrt(4d) returns 2.