admin管理员组

文章数量:1392007

I have a set of variables of type "integer" and I just want to take the greatest of these values, and set as the value for some new variable. How would I do this in as3? (or any language, I suppose)

I have a set of variables of type "integer" and I just want to take the greatest of these values, and set as the value for some new variable. How would I do this in as3? (or any language, I suppose)

Share Improve this question asked Apr 28, 2011 at 18:40 mheaversmheavers 30.2k63 gold badges200 silver badges326 bronze badges
Add a ment  | 

2 Answers 2

Reset to default 10

ActionScript 3:

var highest:Number = Math.max(first, second, third);

where first, second and third are Numbers or ints.

Math.max(var1, Math.max(var2, var3))

本文标签: javascriptselect the highest value in a set of 3 numbers using flash as3Stack Overflow