1. Computing & Technology
Glossary|Tips/Tricks|FREE App/VCL|Best'O'Net|Books|Link Back

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

Floor

unit
math
category
arithmetic routines

declaration
function Floor(X: extended): integer;

description
Returns the smallest near integer number.

Floor rounds X to negative 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 := Floor(-1.9);
x2 := Floor(1.9);
x3 := Floor(-5.0);

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

in real code

see also
Ceil,


 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?

Discuss in my forum

©2012 About.com. All rights reserved.

A part of The New York Times Company.