Difference between revisions of "Bit.tonumb"
From ComputerCraft Wiki
m (Table -> Table (type)) |
m (Use type template) |
||
| Line 2: | Line 2: | ||
{{Function | {{Function | ||
|name=bit.tonumb | |name=bit.tonumb | ||
| − | |args= | + | |args={{Type|table}} bit_tbl |
|api=bit | |api=bit | ||
| − | |returns= | + | |returns={{Type|int}} the number resulting from the conversion of <var>bit_tbl</var> from binary |
|addon=ComputerCraft | |addon=ComputerCraft | ||
|desc=Converts an array (numerically-indexed table) containing binary bit values to a number (the inverse of [[bit.tobits]]) | |desc=Converts an array (numerically-indexed table) containing binary bit values to a number (the inverse of [[bit.tobits]]) | ||
Revision as of 14:16, 22 April 2013
| 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
| 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.