ceil

OPL function to return the smallest integer greater than or equal to a value.

Purpose

OPL function to return the smallest integer greater than or equal to f.

type
float

Syntax

ceil(float f)

Description

Returns the smallest integer greater than or equal to a given floating-point value. You can use this function within IBM ILOG Script statements by specifying the OPL namespace:

( Opl.xxx() )

Example

float a=-2.4;
float b=3.5;

float ceilofa=ceil(a);
float ceilofb=ceil(b);

execute
{
   writeln("ceil(",a,") gives ",ceilofa);
   writeln("ceil(",b,") gives ",ceilofb); 
}

Result

ceil(-2.4) gives -2
ceil(3.5) gives 4