var loc3:*=Math.min(Math.max(arg2 / arg1.things, 0), 1);
If somebody could breakdown what this line of code is doing, i’d greatly appreciate it.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You could rewrite it in the following sequence of steps:
So, to summarize, what that line of code does is it divides the value of
arg2by the values stored inarg1.thingsand it caps the result in the closed interval[0,1]and then it multiplies the value stored inloc3by the capped, computed result of the division. The final result is stored back in theloc3variable.