ceiling: Difference between revisions
Jump to navigation
Jump to search
m (Text replacement - "source>" to "syntaxhighlight>") |
m (Text replacement - "<source" to "<syntaxhighlight") |
||
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)] | ||
Line 10: | Line 10: | ||
|examples= | |examples= | ||
< | <syntaxhighlight lang="mtmacro" line> | ||
[r: ceil(10)] | [r: ceil(10)] | ||
</syntaxhighlight> | </syntaxhighlight> | ||
Returns 10. | Returns 10. | ||
< | <syntaxhighlight lang="mtmacro" line> | ||
[r: ceil(1.2)] | [r: ceil(1.2)] | ||
</syntaxhighlight> | </syntaxhighlight> | ||
Returns 2. | Returns 2. | ||
< | <syntaxhighlight lang="mtmacro" line> | ||
[r: ceil(-1.2)] | [r: ceil(-1.2)] | ||
</syntaxhighlight> | </syntaxhighlight> |
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)]