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

floor

From Quake Wiki

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

float floor(float val)

Usage

Rounds the passed number down to the next lowest whole number.

Parameters

  • val
The number to round down.

Return

Returns the rounded down number.

Example

// When taking damage, remove the fractional part
float damageToTake = floor(damage);
e.health -= damageToTake;