Function Reference


Ceiling

Returns a number rounded up to the next integer.

Ceiling ( expression )

Parameters

expression Any valid numeric expression.

Return Value

Returns the rounded number.

Related

Floor, Int, Number, Round

Example

#include <MsgBoxConstants.au3>
Example()
Func  Example()
; Assign a Local variable an array containing the numbers.
Local $aNumber[8]= [4.8,4.5,4.3,4,- 4.8,- 4.5,- 4.3,- 4]
; Assign a Local variable a string which will contain the results.
Local $sResults= ""
; Loop through the array: calculate the ceiling and format the result.
For $i= 0To 7
$sResults&="Ceiling("&$aNumber[$i]&") = "&Ceiling ($aNumber[$i])&@CRLF &($i= 3?@CRLF :"")
Next
; Display the results.
MsgBox ($MB_SYSTEMMODAL,"",$sResults)
EndFunc ;==>Example

AltStyle によって変換されたページ (->オリジナル) /