DayZ 1.27
DayZ Explorer by KGB
 
Загрузка...
Поиск...
Не найдено

◆ Truncate()

enum ThrowEntityFlags Truncate ( float value,
int decimals = 2 )
protected

truncate float to specified precision

См. определение в файле MiscGameplayFunctions.c строка 195

217 {
218 int multiplier = Math.Pow(10,decimals);
219 return Math.Clamp(Math.Floor(value * multiplier),float.LOWEST, float.MAX) / multiplier;
220 }
Определения EnMath.c:7
const float MAX
Определения EnConvert.c:99
const float LOWEST
Определения EnConvert.c:100
static proto float Floor(float f)
Returns floor of value.
static proto float Clamp(float value, float min, float max)
Clamps 'value' to 'min' if it is lower than 'min', or to 'max' if it is higher than 'max'.
static proto float Pow(float v, float power)
Return power of v ^ power.

Используется в TruncateToS().