Difference between revisions of "Boolean (type)"

From ComputerCraft Wiki
Jump to: navigation, search
(Made this page 100% more helpful & added to CAT:LuaTypes.)
(corrected link)
 
(4 intermediate revisions by 3 users not shown)
Line 1: Line 1:
A '''Boolean value''' (or more commonly, "boolean") represents either a "true" or "false" value. A boolean value is not capable of holding any other data, such as numbers and strings, and is usually used by functions to state whether the function was successful.  
+
A '''Boolean value''' (or more commonly, "boolean") represents either a "true" or "false" value. A boolean value is not capable of holding any other data, such as ([[number (type)|integers]], [[number (type)|floating-point numbers]] and [[string (type)|strings]]) and is usually used by functions to state whether the function was successful.  
  
Boolean values can be used in logic statements (as conditionals), and, can also be expressed as binary, where <var>true</var> is a value of <var>1</var> and <var>false</var> is a value of <var>0</var>.
+
Boolean values can be used in logic statements (as conditionals), and can also be expressed as binary, where <var>true</var> is a value of <var>1</var> and <var>false</var> is a value of <var>0</var>.
  
For a more in-depth and concise explanation of types, please consolidate with the [http://www.lua.org/manual/5.1/manual.html Lua 5.1 Official Manual].
+
For a more in-depth and concise explanation of types, please consult the [http://www.lua.org/manual/5.1/manual.html#2.2 Lua 5.1 Official Manual].
  
 
[[Category:Lua_Types]]
 
[[Category:Lua_Types]]

Latest revision as of 14:43, 18 July 2013

A Boolean value (or more commonly, "boolean") represents either a "true" or "false" value. A boolean value is not capable of holding any other data, such as (integers, floating-point numbers and strings) and is usually used by functions to state whether the function was successful.

Boolean values can be used in logic statements (as conditionals), and can also be expressed as binary, where true is a value of 1 and false is a value of 0.

For a more in-depth and concise explanation of types, please consult the Lua 5.1 Official Manual.