Hosting and domain costs until October 2024 have been generously sponsored by dumptruck_ds. Thank you!
Difference between revisions of "ceil"
From Quake Wiki
Line 1: | Line 1: | ||
− | + | ''float'' '''ceil'''(''float'' val) | |
− | + | == Usage == | |
+ | Rounds the passed number up to the next highest whole number. | ||
+ | |||
+ | === Parameters === | ||
+ | *''val'' | ||
+ | :The number to round up. | ||
+ | |||
+ | === Return === | ||
+ | Returns the rounded up number. | ||
+ | |||
+ | == Example == | ||
+ | // Add a random amount of stacks, guaranteeing it always adds at least one | ||
+ | float toAdd = random() * 5; | ||
+ | self.stacks += ceil(toAdd); |
Latest revision as of 12:43, 1 August 2023
float ceil(float val)
Contents
Usage[edit]
Rounds the passed number up to the next highest whole number.
Parameters[edit]
- val
- The number to round up.
Return[edit]
Returns the rounded up number.
Example[edit]
// Add a random amount of stacks, guaranteeing it always adds at least one float toAdd = random() * 5; self.stacks += ceil(toAdd);