Ceiling Function

   
Ceiling Function

Class

System.Math

Syntax

 Math.Ceiling(   a   ) 
a (required; Double)

Return Value

A Double containing the smallest integer greater than or equal to the argument a

Description

Returns the smallest integer greater than or equal to the argument a

Example

 Console.WriteLine(Math.Ceiling(12.1))     ' Returns 13 Console.WriteLine(Math.Ceiling(12.5))     ' Returns 13 Console.WriteLine(Math.Ceiling(-12.5))    ' Returns -12 Console.WriteLine(Math.Ceiling(-12.8))    ' Returns -12 

Rules at a Glance

  • Because this function can accept only numeric values, you may want to check the value you pass using the IsNumeric function to prevent generating an error.

  • This is a Shared member, so it can be used without creating any objects.

VB.NET/VB 6 Differences

The Ceiling function is new to the .NET Framework.

See Also

Floor Function

   


VB.Net Language in a Nutshell
VB.NET Language in a Nutshell
ISBN: B00006L54Q
EAN: N/A
Year: 2002
Pages: 503

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