# Absolute Value (Integer)
Grammar — Abs(value)
Flags —Native
|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);
# 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
# campaigns/voidstory.sc2campaign
— VoidCampaignMissionLib.galaxy
// L705
AbsI(FixedToInt((lp_duration / lv_incrementFrequency)))
// L751
AbsI(FixedToInt((lp_duration / lv_incrementFrequency)))
# mods/core.sc2mod
// L1679
AbsI((lp_inCount - lv_count))
# mods/heroesbrawlmods/arenamodemods/templearena.stormmod
// L2632
AbsI(libGame_gf_CapturePointCounter(libAMCT_gv_aRMSkyTemple[lv_itTemplIndex].lv_beaconIndex))
# mods/heroesbrawlmods/brawlmapmods/coop/deadmansstand.stormmod
// L2812
AbsI((lv_gapIndex - libPEB1_gv_previousGapIndex))
# mods/heroesdata.stormmod
// L2610
AbsI(lv_teamLevelAdvantage)
# mods/heroesdata.stormmod
// L11312
AbsI((lv_earnedMetaXPValue - lv_trackedXPValueSum))
# mods/heroesdata.stormmod
// L15748
AbsI(lv_talentTierGap)
# mods/heroesmapmods/battlegroundmapmods/skytemple.stormmod
// L3220
AbsI(libGame_gf_CapturePointCounter(libMLCP_gv_mMSkyTemples[lv_itTemplIndex].lv_beaconIndex))
# mods/heromods/dehaka.stormmod
// L1090
AbsI(CatalogFieldValueGetAsInt(c_gameCatalogEffect, "DehakaEssenceCollectionEssenceDevourerTalentModifyChargeCount", "Cost[" + IntToString(0) + "].ChargeCountUse", lv_player))
# mods/starcoop/starcoop.sc2mod
// L7148
AbsI(FixedToInt((lp_duration / lv_incrementFrequency)))
// L7201
AbsI(FixedToInt((lp_duration / lv_incrementFrequency)))
# mods/starcoop/starcoop.sc2mod
// L1189
AbsI(FixedToInt(lv_orderCost))
// L1190
AbsI(FixedToInt(lv_orderCost))
// L1197
AbsI(FixedToInt(lv_orderCost))