Hosting and domain costs until October 2024 have been generously sponsored by dumptruck_ds. Thank you!
Difference between revisions of "floor"
From Quake Wiki
(New page: float '''floor'''(float ''val'') Returns ''val'', rounded up to the integer below (like the equivalent function in C).) |
|||
(One intermediate revision by one other user not shown) | |||
Line 1: | Line 1: | ||
− | + | ''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; |
Latest revision as of 12:40, 1 August 2023
float floor(float val)
Contents
Usage[edit]
Rounds the passed number down to the next lowest whole number.
Parameters[edit]
- val
- The number to round down.
Return[edit]
Returns the rounded down number.
Example[edit]
// When taking damage, remove the fractional part float damageToTake = floor(damage); e.health -= damageToTake;