# Absolute Value (Real)

Grammar — Abs(value)
FlagsNative | Function

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

# Arguments

  • fixed — Value

Returns — fixed

native fixed AbsF(fixed x);

Category: Math / Arithmetic

# Examples

# campaigns/liberty.sc2campaign

MapScript.galaxy

// L6098
AbsF((PointGetY(lv_pos) - PointGetY(gv_bGTarget)))
// L6325
AbsF((UnitGetFacing(lv_plane) - AngleBetweenPoints(lv_posCurrent, UnitGetPosition(gv_viking))))
// L6860
AbsF(lv_angleInterval)
// L6862
AbsF((lv_speed / 0.0625))
// L35
AbsF((PointGetX(RegionGetBoundsMax(lp_circle)) - PointGetX(RegionGetBoundsMin(lp_circle))))
// L15215
AbsF((lv_offsetTarget - lv_offsetOriginal))
// L6098
AbsF((PointGetY(lv_pos) - PointGetY(gv_bGTarget)))
// L6325
AbsF((UnitGetFacing(lv_plane) - AngleBetweenPoints(lv_posCurrent, UnitGetPosition(gv_viking))))
// L6860
AbsF(lv_angleInterval)
// L6862
AbsF((lv_speed / 0.0625))
// L35
AbsF((PointGetX(RegionGetBoundsMax(lp_circle)) - PointGetX(RegionGetBoundsMin(lp_circle))))
// L15215
AbsF((lv_offsetTarget - lv_offsetOriginal))

# campaigns/libertystory.sc2campaign

CampaignLib.galaxy

// L1680
AbsF(lp_grid)
// L1713
AbsF(lp_value)

# mods/core.sc2mod

NativeLib.galaxy

// L4171
AbsF((PointGetX(RegionGetBoundsMax(lp_region)) - PointGetX(RegionGetBoundsMin(lp_region))))
// L4177
AbsF((PointGetY(RegionGetBoundsMax(lp_region)) - PointGetY(RegionGetBoundsMin(lp_region))))
// L3470
AbsF((PointGetX(RegionGetBoundsMax(lp_region)) - PointGetX(RegionGetBoundsMin(lp_region))))
// L3476
AbsF((PointGetY(RegionGetBoundsMax(lp_region)) - PointGetY(RegionGetBoundsMin(lp_region))))

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

LibPVEB.galaxy

// L1476
AbsF(DistanceBetweenPoints(lv_ptPre, lv_ptUnit))
// L1477
AbsF(DistanceBetweenPoints(lv_ptNext, lv_ptUnit))
// L1506
AbsF((lv_distanceUnitPre * Sin((lv_angelUnit - lv_angelLane))))
// L1508
AbsF((lv_distanceUnitPre * Cos((lv_angelUnit - lv_angelLane))))

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

LibPVEM.galaxy

// L147
AbsF(DistanceBetweenPoints(lv_ptPre, lv_ptUnit))
// L148
AbsF(DistanceBetweenPoints(lv_ptNext, lv_ptUnit))
// L177
AbsF((lv_distanceUnitPre * Sin((lv_angelUnit - lv_angelLane))))
// L179
AbsF((lv_distanceUnitPre * Cos((lv_angelUnit - lv_angelLane))))

# mods/heroesbrawlmods/brawlmapmods/lunarfestival.stormmod

LibLNYF.galaxy

// L1531
AbsF(libLNYF_gv_movement.lv_facing_Current[autoE34AC8EB_var])
// L1531
AbsF(libLNYF_gv_movement.lv_facing_Old[autoE34AC8EB_var])
// L1532
AbsF(libLNYF_gv_movement.lv_facing_Current[autoE34AC8EB_var])
// L1532
AbsF(libLNYF_gv_movement.lv_facing_Old[autoE34AC8EB_var])
// L1534
AbsF(libLNYF_gv_movement.lv_facing_Old[autoE34AC8EB_var])
// L1534
AbsF(libLNYF_gv_movement.lv_facing_Current[autoE34AC8EB_var])
// L1535
AbsF(libLNYF_gv_movement.lv_facing_Old[autoE34AC8EB_var])
// L1535
AbsF(libLNYF_gv_movement.lv_facing_Current[autoE34AC8EB_var])
// L1537
AbsF(libLNYF_gv_movement.lv_facing_Old[autoE34AC8EB_var])
// L1537
AbsF(libLNYF_gv_movement.lv_facing_Current[autoE34AC8EB_var])

# mods/heroesdata.stormmod

HeroesLib.galaxy

// L2140
AbsF(Trunc(lv_levelDifferenceReal))
// L2142
AbsF(ModF(lv_levelDifferenceReal, 1.0))
// L2842
AbsF((lp_angle1 - lp_angle2))
// L2844
AbsF((lv_diff - 360.0))

# mods/heromods/alexstrasza.stormmod

LibHALE.galaxy

// L110
AbsF((lv_targetHealthPercent - lv_alexstraszaHealthPercent))

# mods/heromods/imperius.stormmod

LibHIMP.galaxy

// L129
AbsF((lv_imperiusUnitFacing360 - lv_relativeAngle360))
// L129
AbsF(((lv_imperiusUnitFacing360 + lv_relativeAngle360) - 360.0))

# mods/heromods/malthael.stormmod

LibHMTH.galaxy

// L225
AbsF(libHMTH_gv_heroMalthaelTouchOfDeathHealingPreventScale)
// L226
AbsF(libHMTH_gv_heroMalthaelTouchOfDeathHealingPreventScale)

# mods/heromods/thefirelords.stormmod

LibHMaj.galaxy

// L332
AbsF(UnitGetPropertyFixed(EventUnit(), c_unitPropLifeRegen, c_unitPropCurrent))
// L334
AbsF(UnitGetPropertyFixed(EventUnit(), c_unitPropLifeRegen, c_unitPropCurrent))

# mods/novastoryassets.sc2mod

MapScript.galaxy

// L4403
AbsF((UnitGetFacing(gv_s2_Davis) - AngleBetweenPoints(UnitGetPosition(gv_s2_Davis), UnitGetPosition(gv_nova))))
// L4687
AbsF((PointGetFacing(PointFromId(599)) - UnitGetFacing(gv_xanthos)))
// L4403
AbsF((UnitGetFacing(gv_s2_Davis) - AngleBetweenPoints(UnitGetPosition(gv_s2_Davis), UnitGetPosition(gv_nova))))
// L4687
AbsF((PointGetFacing(PointFromId(599)) - UnitGetFacing(gv_xanthos)))

# mods/starcoop/starcoop.sc2mod

LibCOMI.galaxy

// L17319
AbsF(libCOMI_gv_cM_DehakaEatReviveTimerAdjustment)

# mods/warcoop/legends/gromhellscream.sc2mod

LibLGrm.galaxy

// L47
AbsF((lv_startingclifflevel - PointPathingCliffLevel(lv_currentpoint)))