ceiling: Difference between revisions
Jump to navigation
Jump to search
Verisimilar (talk | contribs) No edit summary |
m (Text replacement - "<source" to "<syntaxhighlight") |
||
(5 intermediate revisions by 3 users not shown) | |||
Line 4: | Line 4: | ||
|usage= | |usage= | ||
< | <syntaxhighlight lang="mtmacro" line> | ||
[h: val = ceil(num)] | [h: val = ceil(num)] | ||
[h: val = ceiling(num)] | [h: val = ceiling(num)] | ||
</ | </syntaxhighlight> | ||
|examples= | |examples= | ||
< | <syntaxhighlight lang="mtmacro" line> | ||
[r: ceil(10)] | [r: ceil(10)] | ||
</ | </syntaxhighlight> | ||
Returns 10. | Returns 10. | ||
< | <syntaxhighlight lang="mtmacro" line> | ||
[r: ceil(1.2)] | [r: ceil(1.2)] | ||
</ | </syntaxhighlight> | ||
Returns 2. | Returns 2. | ||
< | <syntaxhighlight lang="mtmacro" line> | ||
[r: ceil(-1.2)] | [r: ceil(-1.2)] | ||
</ | </syntaxhighlight> | ||
Returns -1. | Returns -1. | ||
}} | }} | ||
[[Category:Mathematical Function]] | [[Category:Mathematical Function]] |
Latest revision as of 23:59, 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)]