# 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
- Absolute Value (Integer) —
int
— AbsI - Absolute Value (Real) —
fixed
— AbsF - Arithmetic (Integer)
- Bitwise Arithmetic (Integer)
- Arithmetic (Real)
- Arithmetic Multiple (Integer)
- Bitwise Arithmetic Multiple (Integer)
- Arithmetic Multiple (Real)
- Ceiling (Integer) —
int
— CeilingI - Ceiling (Real) —
fixed
— Ceiling - Clamp (Integer) —
int
— libNtve_gf_ArithmeticIntClamp - Clamp (Real) —
fixed
— libNtve_gf_ArithmeticRealClamp - Cycle
- Floor (Integer) —
int
— FloorI - Floor (Real) —
fixed
— Floor - Log2 (Integer) —
int
— Log2I - Log2 (Real) —
fixed
— Log2 - Log (Real) —
fixed
— libNtve_gf_Log - Modulo (Integer) —
int
— ModI - Modulo (Real) —
fixed
— ModF - Power (Integer) —
int
— PowI - Power (Real) —
fixed
— Pow - Round (Integer) —
int
— RoundI - Round (Real) —
fixed
— Round - Pow2 (Integer) —
int
— Pow2I - Pow2 (Real) —
fixed
— Pow2 - Square Root (Integer) —
int
— SquareRootI - Square Root (Real) —
fixed
— SquareRoot - Trunc (Integer) —
int
— TruncI - Trunc (Real) —
fixed
— Trunc
# Examples
mods/heroesdata.stormmod — base.stormdata/TriggerLibs/AILib.galaxy:2487
else {
}
libGame_gf_ModifyTokenCount(TruncI(lv_aiThreatValue), lv_lanePowerDelegateToken, libGame_gv_teams[lp_teamID].lv_core);
}
mods/heroesdata.stormmod — base.stormdata/TriggerLibs/AILib.galaxy:2541
return ;
}
libGame_gf_ModifyTokenCount(TruncI(lv_aiThreatValue), lv_lanePowerDelegateToken, libGame_gv_teams[lp_teamID].lv_core);
}
mods/heroesmapmods/battlegroundmapmods/braxisholdout.stormmod — base.stormdata/LibSCHO.galaxy:4046
libSCHO_gf_MMHOControlSlabAnimationsProgress(libGame_gv_teamOrderIndex_C);
libSCHO_gv_mMHO_TeamProgress[libGame_gv_teamOrderIndex_C] += libSCHO_gv_mMHO_ControlBeaconProgressIncrement_C;
libAIAI_gf_AITeamDelegateAdjustMapEventProgressforTeam(TruncI(libSCHO_gv_mMHO_ControlBeaconProgressIncrement_C), libGame_gv_teamOrderIndex_C);
if ((libSCHO_gv_mMHO_TeamProgress[libGame_gv_teamOrderIndex_C] > 100.0)) {
libSCHO_gv_mMHO_TeamProgress[libGame_gv_teamOrderIndex_C] = 100.0;
mods/heroesmapmods/battlegroundmapmods/braxisholdout.stormmod — base.stormdata/LibSCHO.galaxy:4067
libSCHO_gf_MMHOControlSlabAnimationsProgress(libGame_gv_teamChaosIndex_C);
libSCHO_gv_mMHO_TeamProgress[libGame_gv_teamChaosIndex_C] += libSCHO_gv_mMHO_ControlBeaconProgressIncrement_C;
libAIAI_gf_AITeamDelegateAdjustMapEventProgressforTeam(TruncI(libSCHO_gv_mMHO_ControlBeaconProgressIncrement_C), libGame_gv_teamChaosIndex_C);
if ((libSCHO_gv_mMHO_TeamProgress[libGame_gv_teamChaosIndex_C] > 100.0)) {
libSCHO_gv_mMHO_TeamProgress[libGame_gv_teamChaosIndex_C] = 100.0;
mods/starcoop/starcoop.sc2mod — base.sc2data/LibCOMI.galaxy:2643
if ((UnitTypeGetCost(lv_unitTypesForWave[lv_unitPercentBaseIter], c_unitCostSumMineralsVespene) > 0)) {
lv_unitPercentBaseCreateCount = MaxI(TruncI((lv_unitTypePercentBase[lv_unitPercentBaseIter] * lv_waveResourceTotal / UnitTypeGetCost(lv_unitTypesForWave[lv_unitPercentBaseIter], c_unitCostSumMineralsVespene))), 1);
}
else {
mods/starcoop/starcoop.sc2mod — base.sc2data/LibCOMI.galaxy:2647
else {
breakpoint;
lv_unitPercentBaseCreateCount = TruncI((lv_unitTypePercentBase[lv_unitPercentBaseIter] * lv_waveResourceTotal / 125.0));
}
autoEA202307_ae = lv_unitPercentBaseCreateCount;
mods/starcoop/starcoop.sc2mod — base.sc2data/LibCOMI.galaxy:2999
if ((UnitTypeGetCost(lv_unitTypesForWave[lv_unitPercentBaseIter], c_unitCostSumMineralsVespene) > 0)) {
lv_unitPercentBaseCreateCount = MaxI(TruncI((lv_unitTypePercentBase[lv_unitPercentBaseIter] * lv_waveResourceTotal / UnitTypeGetCost(lv_unitTypesForWave[lv_unitPercentBaseIter], c_unitCostSumMineralsVespene))), 1);
}
else {
mods/starcoop/starcoop.sc2mod — base.sc2data/LibCOMI.galaxy:3003
else {
breakpoint;
lv_unitPercentBaseCreateCount = TruncI((lv_unitTypePercentBase[lv_unitPercentBaseIter] * lv_waveResourceTotal / 125.0));
}
autoA1B74908_ae = lv_unitPercentBaseCreateCount;
mods/starcoop/starcoop.sc2mod — base.sc2data/LibCOMI.galaxy:15344
lv_biomassCountTargetTotal += (UnitBehaviorCount(EventPlayerEffectUsedUnit(c_effectUnitTarget), "BiomassBuff10") * 10);
lv_biomassCountTargetTotal += UnitBehaviorCount(EventPlayerEffectUsedUnit(c_effectUnitTarget), "BiomassBuff1");
lv_biomass100Stacks = TruncI((lv_biomassCountStoredTemp / 100));
lv_biomassCountStoredTemp -= (lv_biomass100Stacks * 100);
lv_biomass10Stacks = TruncI((lv_biomassCountStoredTemp / 10));
mods/starcoop/starcoop.sc2mod — base.sc2data/LibCOMI.galaxy:15346
lv_biomass100Stacks = TruncI((lv_biomassCountStoredTemp / 100));
lv_biomassCountStoredTemp -= (lv_biomass100Stacks * 100);
lv_biomass10Stacks = TruncI((lv_biomassCountStoredTemp / 10));
lv_biomassCountStoredTemp -= (lv_biomass10Stacks * 10);
lv_biomass1Stacks = lv_biomassCountStoredTemp;
mods/starcoop/starcoop.sc2mod — base.sc2data/LibCOMI.galaxy:15356
libCOMI_gf_CM_Abathur_BiomassScale(EventPlayerEffectUsedUnit(c_effectUnitCaster), false);
libCOMI_gv_cM_DebugAbathurBiomassCollected += lv_biomassCountStoredTemp;
lv_biomass100Stacks = TruncI((lv_biomassCountStoredTemp / 100));
lv_biomassCountStoredTemp -= (lv_biomass100Stacks * 100);
lv_biomass10Stacks = TruncI((lv_biomassCountStoredTemp / 10));
mods/starcoop/starcoop.sc2mod — base.sc2data/LibCOMI.galaxy:15358
lv_biomass100Stacks = TruncI((lv_biomassCountStoredTemp / 100));
lv_biomassCountStoredTemp -= (lv_biomass100Stacks * 100);
lv_biomass10Stacks = TruncI((lv_biomassCountStoredTemp / 10));
lv_biomassCountStoredTemp -= (lv_biomass10Stacks * 10);
lv_biomass1Stacks = lv_biomassCountStoredTemp;