Hosting and domain costs until October 2024 have been generously sponsored by dumptruck_ds. Thank you!

ceil

From Quake Wiki

Revision as of 12:43, 1 August 2023 by Boondorl (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

float ceil(float val)

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);