2014-02-27 26 views

回答

4

这确实是一个短路。它的等值在C将是:

width = aspectRatio > 1.5 ? 320 : math.ceil(480/aspectRatio) 

或英文:如果纵横比大于1.5,将宽度设置为320,否则将宽度设置为大于或等于该最小积分值480的分割和纵横比。

参考

http://www.lua.org/pil/3.3.html

+0

真棒感谢队友 – user2206329