If yes return true, if not return falseĮqual or great than. check if the value on the left is greater than the value on the right. checks whether the two values are equal,if equal returns false, if not return true checks whether the two values are equal, if equal returns true, if not return false The following table lists the commonly used relational operators in Lua language, setting the value of a to 10 and the value of b to 20: OperatorĮqual to. Print ( "value of Line 7 - c is ", c ) -Print result: -value of Line 1 - c is 31 -value of Line 2 - c is 11 -value of Line 3 - c is 210 -value of Line 4 - c is 2.1 -value of Line 5 - c is 1 -value of Line 6 - c is 441 -value of Line 7 - c is -21 relational operator Represents a separate line of execution used to execute a coroutineĬ = a ^ 2 print ( "value of Line 6 - c is ", c ) Represents any C data structure stored in a variable # Lua Data Type Data NameĪn invalid value(The equivalent of false in a conditional expression)īoolean value containing two values: false and trueĪ real number, representing a real floating point number of type double, or an integerĪ string, represented by a pair of single or double quotesĪ data structure of Lua, used to create different data types, such as arrays, dictionaries, and etc In other words, a variable only exists when it is not equal to nil.
0 Comments
Leave a Reply. |