ceiling: Difference between revisions

From RPTools Wiki
Jump to navigation Jump to search
(Redirecting to Macros:Functions:ceil)
 
m (Text replacement - "<source" to "<syntaxhighlight")
 
(5 intermediate revisions by 3 users not shown)
Line 1: Line 1:
#REDIRECT [[Macros:Functions:ceil]]
{{MacroFunction
|name=ceiling
|description=Returns the number passed in if it is an integer, otherwise it returns the number rounded up to the next integer.
 
|usage=
<syntaxhighlight lang="mtmacro" line>
[h: val = ceil(num)]
[h: val = ceiling(num)]
</syntaxhighlight>
 
|examples=
<syntaxhighlight lang="mtmacro" line>
[r: ceil(10)]
</syntaxhighlight>
Returns 10.
 
<syntaxhighlight lang="mtmacro" line>
[r: ceil(1.2)]
</syntaxhighlight>
Returns 2.
 
<syntaxhighlight lang="mtmacro" line>
[r: ceil(-1.2)]
</syntaxhighlight>
Returns -1.
}}
[[Category:Mathematical Function]]

Latest revision as of 18:05, 14 March 2023

ceiling() Function

Returns the number passed in if it is an integer, otherwise it returns the number rounded up to the next integer.

Usage

[h: val = ceil(num)]
[h: val = ceiling(num)]

Examples

[r: ceil(10)]

Returns 10.

[r: ceil(1.2)]

Returns 2.

[r: ceil(-1.2)]
Returns -1.