DIAdem API Reference

Function: Ceil

  • Updated2023-02-21
  • 2 minute(s) read

Specifies the integer part of a number, where the function rounds up the transferred value to obtain an integer number. For negative numbers the function returns integer numbers that are greater than or equal to the Value argument.

ReturnValue = Ceil(Value)

Input Parameters

Value Specifies a numeric value, a variable, or a data channel.

Return Parameters

ReturnValueReturns integer values.

Examples

The following example rounds up some values:

VBScriptPython

 

Call MsgBox(Ceil(2.6))  '=> 3
Call MsgBox(Ceil(2.1))  '=> 3
Call MsgBox(Ceil(-2.1)) '=> -2
Call MsgBox(Ceil(-2.6)) '=> -2

The following example rounds up the values in the Group1/Input data channel and saves the result in the Group2/Result data channel.

VBScriptPython

 

Call Calculate ("Ch(""Group2/Result"")= Ceil (Ch(""Group1/Input""))")
Note  You must use the Calculate command in scripts to calculate data channels with formulas. Compute the data channels according to the syntax in the Calculator. Refer to the procedures Executing Channel Calculations in the Calculator and Assigning a Value to a Variable in the Calculator for more information about the Calculator.
The physical input quantities and the result quantities are the same.
The Input and Result Quantities for Quantity-Based Calculations page contains an overview of the input quantities and result quantities of all functions. Refer to the Help page Calculating Quantity-Based and Non-Quantity-Based in DIAdem for the conditions and rules for quantity-based calculations.

Related Topics

Floor | Int | Round | Trunc