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

rint

From Quake Wiki

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

float rint(float val)

Usage

Rounds the passed number to the nearest whole number.

Parameters

  • val
The number to round.

Return

Returns the rounded number.

Example

// Performs an action with a 50/50 chance
float chance = random();
if (rint(chance))
    DoAction();