# Trunc (Integer)
Grammar — Trunc(x)
Flags —Native
|Function
Strips off the fractional portion of a real.
# Arguments
fixed
— Value
Returns — int
native int TruncI(fixed x);
# Related
Category: Math / Arithmetic
- [F] —
int
— Absolute Value (Integer) — ( AbsI ) - [F] —
fixed
— Absolute Value (Real) — ( AbsF ) - [F] —
int
— Arithmetic (Integer) — ( ) - [F] —
int
— Bitwise Arithmetic (Integer) — ( ) - [F] —
fixed
— Arithmetic (Real) — ( ) - [F] —
int
— Arithmetic Multiple (Integer) — ( ) - [F] —
int
— Bitwise Arithmetic Multiple (Integer) — ( ) - [F] —
fixed
— Arithmetic Multiple (Real) — ( ) - [F] —
int
— Ceiling (Integer) — ( CeilingI ) - [F] —
fixed
— Ceiling (Real) — ( Ceiling ) - [F] —
int
— Clamp (Integer) — ( libNtve_gf_ArithmeticIntClamp ) - [F] —
fixed
— Clamp (Real) — ( libNtve_gf_ArithmeticRealClamp ) - [F] —
void
— Cycle — ( ) - [F] —
int
— Floor (Integer) — ( FloorI ) - [F] —
fixed
— Floor (Real) — ( Floor ) - [F] —
int
— Log2 (Integer) — ( Log2I ) - [F] —
fixed
— Log2 (Real) — ( Log2 ) - [F] —
fixed
— Log (Real) — ( libNtve_gf_Log ) - [F] —
int
— Modulo (Integer) — ( ModI ) - [F] —
fixed
— Modulo (Real) — ( ModF ) - [F] —
int
— Power (Integer) — ( PowI ) - [F] —
fixed
— Power (Real) — ( Pow ) - [F] —
int
— Round (Integer) — ( RoundI ) - [F] —
fixed
— Round (Real) — ( Round ) - [F] —
int
— Pow2 (Integer) — ( Pow2I ) - [F] —
fixed
— Pow2 (Real) — ( Pow2 ) - [F] —
int
— Square Root (Integer) — ( SquareRootI ) - [F] —
fixed
— Square Root (Real) — ( SquareRoot ) - [F] —
int
— Trunc (Integer) — ( TruncI ) - [F] —
fixed
— Trunc (Real) — ( Trunc )
# Examples
# mods/heroesdata.stormmod
// L2487
TruncI(lv_aiThreatValue)
// L2541
TruncI(lv_aiThreatValue)
# mods/heroesmapmods/battlegroundmapmods/braxisholdout.stormmod
// L4046
TruncI(libSCHO_gv_mMHO_ControlBeaconProgressIncrement_C)
// L4067
TruncI(libSCHO_gv_mMHO_ControlBeaconProgressIncrement_C)
# mods/starcoop/starcoop.sc2mod
// L2643
TruncI((lv_unitTypePercentBase[lv_unitPercentBaseIter] * lv_waveResourceTotal / UnitTypeGetCost(lv_unitTypesForWave[lv_unitPercentBaseIter], c_unitCostSumMineralsVespene)))
// L2647
TruncI((lv_unitTypePercentBase[lv_unitPercentBaseIter] * lv_waveResourceTotal / 125.0))
// L2999
TruncI((lv_unitTypePercentBase[lv_unitPercentBaseIter] * lv_waveResourceTotal / UnitTypeGetCost(lv_unitTypesForWave[lv_unitPercentBaseIter], c_unitCostSumMineralsVespene)))
// L3003
TruncI((lv_unitTypePercentBase[lv_unitPercentBaseIter] * lv_waveResourceTotal / 125.0))
// L15341
TruncI((lv_biomassCountStoredTemp / 100))
// L15343
TruncI((lv_biomassCountStoredTemp / 10))
// L15353
TruncI((lv_biomassCountStoredTemp / 100))
// L15355
TruncI((lv_biomassCountStoredTemp / 10))