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

fabs

From Quake Wiki

float fabs(float val)

Usage[edit]

Gets the absolute value of a number.

Parameters[edit]

  • val
The number to get the absolute value of.

Return[edit]

The absolute value of the passed number.

Example[edit]

// If the offset is large enough, do a special action
float offset = crandom() * 5;
if (fabs(offset) > 2.5)
    DoSpecialAction();

spread.x *= offset;
spread.y *= offset;