added RoundFloat and deprecated FloatRound

--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%40851
This commit is contained in:
David Anderson 2007-05-23 15:49:28 +00:00
parent 6f7f487275
commit 0e8ba9ed15

View File

@ -213,21 +213,25 @@ native Float:ArcSine(Float:angle);
native Float:ArcTangent2(Float:x, Float:y);
/**
* Different methods of rounding.
* Rounds a floating point number using the "round to nearest" algorithm.
*
* @param value Floating point value to round.
* @return The value rounded to the nearest integer.
*/
enum floatround_method
stock RoundFloat(Float:value)
{
floatround_round = 0, /**< Standard IEEE rounding */
floatround_floor, /**< Next lowest integer value. */
floatround_ceil, /**< Next highest integer value. */
floatround_tozero /** Closest integer to zero. */
};
return RoundToNearest(value);
}
/**
* Backwards compatibility - use RoundToNearest or any of the other rounding natives.
* Backwards compatibility stock. Do not use.
*
* @deprecated
*/
native FloatRound(Float:value, floatround_method:method=floatround_round);
stock FloatRound(Float:value)
{
return RoundToNearest(value);
}
/**
* User defined operators.