Difference between revisions of "Bit.tonumb"
From ComputerCraft Wiki
m (Moved to CAT:APIFunctions) |
m (Table -> Table (type)) |
||
Line 2: | Line 2: | ||
{{Function | {{Function | ||
|name=bit.tonumb | |name=bit.tonumb | ||
− | |args=[[ | + | |args=[[Table_(type)|Table]] bit_tbl |
|api=bit | |api=bit | ||
|returns=[[int (type)|int]] the number resulting from the conversion of <var>bit_tbl</var> from binary | |returns=[[int (type)|int]] the number resulting from the conversion of <var>bit_tbl</var> from binary |
Revision as of 18:46, 30 November 2012
Function bit.tonumb | |
Converts an array (numerically-indexed table) containing binary bit values to a number (the inverse of bit.tobits) | |
Syntax | bit.tonumb(Table bit_tbl) |
Returns | int the number resulting from the conversion of bit_tbl from binary |
Part of | ComputerCraft |
API | bit |
Examples
Example | |
Convert the binary representation 10010 into its corresponding value, 18 | |
Code |
t = {} |
Output | 18 |
As of ComputerCraft 1.42 the bit library has moved to Java code, and as such this function is no longer required or included.