+ 1

MATH.abs

What does this statement actually do? MATH.abs(Math.min(-9,2)?

3rd Jan 2018, 2:08 PM
Rohan Patel
Rohan Patel - avatar
2 ответов
+ 16
absolute value means distance from the origin & distance can't be in negative , so u can say its just return mod value
3rd Jan 2018, 2:51 PM
Gaurav Agrawal
Gaurav Agrawal - avatar
+ 9
Math.min (argument1, argument2) returns the smallest of the two arguments (i.e. -9). Math.abs (argument) returns the absolute value of the argument, ignoring the sign (+ or -) on it. That's why it results in 9.
3rd Jan 2018, 2:17 PM
Dev
Dev - avatar