英语书,请酌情下载
Lua looked between the parentheses, saw 2+2, added two and two, and followed the print command and output the result to the screen. It then displayed another prompt to tell you it was ready for more.
Lua can handle subtraction, negative numbers, numbers with decimal points, multiplication (using *), division (using /), exponentiation (using ^), and combinations of these. Here are some examples
> print(2 - 2)
0
> print(-2 + -2)
-4
> print(2.5 + 2.75)
5.25
> print(3 * 3)
9
> print(100 / 4)
25
> print(3 ^ 2)
9
> print(5 * -5 + 1 + 1 + 0.5)
-22.5