# Absolute Value (Integer)

Grammar — Abs(value)
FlagsNative | Function

Returns the value of the integer without regard to the sign of the integer.

# Arguments

  • int — Value

Returns — int

native int AbsI(int x);

Category: Math / Arithmetic

# Examples

# campaigns/voidstory.sc2campaign

VoidCampaignMissionLib.galaxy

// L705
AbsI(FixedToInt((lp_duration / lv_incrementFrequency)))
// L751
AbsI(FixedToInt((lp_duration / lv_incrementFrequency)))

# mods/core.sc2mod

NativeLib.galaxy

// L1679
AbsI((lp_inCount - lv_count))

# mods/heroesbrawlmods/arenamodemods/templearena.stormmod

LibAMCT.galaxy

// L2632
AbsI(libGame_gf_CapturePointCounter(libAMCT_gv_aRMSkyTemple[lv_itTemplIndex].lv_beaconIndex))

# mods/heroesbrawlmods/brawlmapmods/coop/deadmansstand.stormmod

LibPEB1.galaxy

// L2812
AbsI((lv_gapIndex - libPEB1_gv_previousGapIndex))

# mods/heroesdata.stormmod

AILib.galaxy

// L2610
AbsI(lv_teamLevelAdvantage)

# mods/heroesdata.stormmod

GameLib.galaxy

// L11312
AbsI((lv_earnedMetaXPValue - lv_trackedXPValueSum))

# mods/heroesdata.stormmod

UILib.galaxy

// L15748
AbsI(lv_talentTierGap)

# mods/heroesmapmods/battlegroundmapmods/skytemple.stormmod

LibMLCP.galaxy

// L3220
AbsI(libGame_gf_CapturePointCounter(libMLCP_gv_mMSkyTemples[lv_itTemplIndex].lv_beaconIndex))

# mods/heromods/dehaka.stormmod

LibHDEH.galaxy

// L1090
AbsI(CatalogFieldValueGetAsInt(c_gameCatalogEffect, "DehakaEssenceCollectionEssenceDevourerTalentModifyChargeCount", "Cost[" + IntToString(0) + "].ChargeCountUse", lv_player))

# mods/starcoop/starcoop.sc2mod

LibCOMI.galaxy

// L7148
AbsI(FixedToInt((lp_duration / lv_incrementFrequency)))
// L7201
AbsI(FixedToInt((lp_duration / lv_incrementFrequency)))

# mods/starcoop/starcoop.sc2mod

LibCOMU.galaxy

// L1189
AbsI(FixedToInt(lv_orderCost))
// L1190
AbsI(FixedToInt(lv_orderCost))
// L1197
AbsI(FixedToInt(lv_orderCost))