1. Technology
Send to a Friend via Email
Glossary|Tips/Tricks|FREE App/VCL|Best'O'Net|Books|Link Back

Delphi Programming RTL Reference|By Category|Alphabetically|By Unit
 

Ceil

unit
math
category
arithmetic routines

declaration
function Ceil(X: extended): integer;

description
Returns the largest near integer number.

Ceil rounds X to positive infinity and returns the nearest whole integer nubmer.
The absolute value of X must be less than MaxInt.

example
var x1,x2,x3 : integer;
	
x1 := Ceil(-1.2);
x2 := Ceil(1.2);
x3 := Ceil(-5.0);

//x1 = -2
//x2 = 1
//x3 = -5

in real code

see also
Floor,


 Free Delphi code snippet inside every Delphi Newsletter!
Subscribe to the Newsletter
Name
Email

 Got some code to share? Got a question? Need some help?

©2014 About.com. All rights reserved.