Ceiling Function


Ceiling Function

Class

System.Math

Syntax

     Dim result As Double = Math.Ceiling(d) 


d (required; Double)

Any valid number

Description

The Ceiling function returns the smallest integer greater than or equal to the argument d.

Example

     MsgBox(Math.Ceiling(12.1))     ' Displays 13     MsgBox(Math.Ceiling(12.5))     ' Displays 13     MsgBox(Math.Ceiling(-12.5))    ' Displays -12     MsgBox(Math.Ceiling(-12.8))    ' Displays -12 

Usage at a Glance

This is a shared member of the System.Math class, so it can be used without an instance.

Version Differences

The Ceiling function did not exist in VB 6.

See Also

Floor Function




Visual Basic 2005(c) In a Nutshell
Visual Basic 2005 in a Nutshell (In a Nutshell (OReilly))
ISBN: 059610152X
EAN: 2147483647
Year: 2004
Pages: 712

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net