Skip to main content

ceil (Function)

This function returns the smallest double value, i.e., the closest to the negative infinity, that is greater than or equal to the p1 argument, and is equal to a mathematical integer. It wraps the java.lang.Math.ceil() method.

Syntax

<DOUBLE> math:ceil(<FLOAT|DOUBLE> p1)

Query Parameters

NameDescriptionDefault ValuePossible Data TypesOptionalDynamic
p1The value of the parameter whose ceiling value is found.FLOAT DOUBLENoYes

Example 1

CREATE STREAM InValueStream (inValue double);

@info(name = 'calculateCeilingValue')
INSERT INTO OutMediationStream
SELECT math:ceil(inValue) AS ceilingValue
FROM InValueStream;

The query takes the inValue from the input stream InValueStream and uses the math:ceil() function to calculate the smallest integer value that is greater than or equal to the given inValue. The result is directed to the output stream OutMediationStream. For example, when inValue is 423.187, the ceilingValue returned is 424.0.