No longer a problem

( Removed because this is no longer an issue )

image
:thinking:

8 Likes

math.abs returns the absolute value of number x.

Absolute Value is a number to explain the “distance” of a number to zero. (aka it will always return a positive value)

math.abs(5) = 5
math.abs(-5) = 5
math.abs(4) = 4
math.abs(-4) = 4
5 Likes

It’s absolute value. Meaning, when you place a number within the parameters for math.abs, it will return it’s value as a positive number, regardless of whether it’s positive or negative. Read about it here on Khan Academy. In simple terms, absolute value is that value’s distance from zero. -4 is the same distance from 0 as 4, so the absolute value is 4. I hope this helps!

4 Likes

math.abs returns the absolute value of a number. In math sometimes we use || around a number to get the absolute value, so |-2| would be equal to 2. If you have learned this already I’m not sure, but in otherwise it is a very simple math function. It will always return the absolute value of a number, meaning it is always positive and never negative. Hope this helps!

1 Like

“abs” stands for Absolute Value. In math, an absolute value number always stays an positive number, regardless if it’s negative or not. So for example, local abs = math.abs(-50) print(abs) That would print out positive 50, because the abs function made -50 into a absolute value number.

Basically it turns both positive or negative number to positive.

print(-1) --> -1

using math.abs()

print(math.abs(-1)) --> 1
1 Like

My man… At least just say you didn’t even look.

4 Likes

math.abs converts the absolute value of a number, for example, if a number is negative, it will return positive and vice versa, i dont get how you dint found answer of what math.abs does cause its in official roblox api reference, if you dint understood, math.abs returns always a positive value of a number, for example:

-- basic usages 

math.abs(-100) = 100
math.abs(100) = 100 -- its already a positive number

-- better understanding

if rawequal(math.abs(-100),100) == true then

print("Its true!")

end

local RandomNumber = math.random(-400,400)

print(math.abs(RandomNumber)) -- Will return positive if RandomNumber returned negarive
1 Like

It returns the absolute value of a number. That’s it🤔

This was solved 2 hours ago. Everyone chill.

7 Likes