Confused on question | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Confused on question

When you have math.abs(math.min(-6,3)) should the answer be 3 not the 6 like the question answer states

9th Jun 2019, 9:29 PM
V H
V H - avatar
2 Answers
+ 2
Math.min returns the smaller of the two number -6 < 3 -> -6 gets returned Math.abs makes the number positive so -6 -> 6
9th Jun 2019, 9:38 PM
Anton Böhler
Anton Böhler - avatar
0
i get it now for some reason I was thinking abs was called first followed by min which would have the result of 3
10th Jun 2019, 2:44 AM
V H
V H - avatar