Difference between revisions of "Bit"
(→Functions) |
(→Functions) |
||
Line 58: | Line 58: | ||
=== bxor2 === | === bxor2 === | ||
'''Definition:'''<br> | '''Definition:'''<br> | ||
− | <br><br> | + | <br><br> (HTTPLIB) |
− | '''Description:''' <br> | + | '''Description:''' <br> |
<br><br> | <br><br> | ||
'''Example:'''<br> | '''Example:'''<br> | ||
Line 67: | Line 67: | ||
=== tonumb === | === tonumb === | ||
'''Definition:'''<br> | '''Definition:'''<br> | ||
− | bit.tonumb(bit_tbl) | + | bit.tonumb(bit_tbl) (HTTPLIB) |
<br><br> | <br><br> | ||
'''Description:''' <br> | '''Description:''' <br> | ||
Line 77: | Line 77: | ||
=== blshift === | === blshift === | ||
'''Definition:'''<br> | '''Definition:'''<br> | ||
− | bit.lshift(a,b) | + | bit.lshift(a,b) (HTTPLIB) |
<br><br> | <br><br> | ||
'''Description:''' <br> | '''Description:''' <br> | ||
Line 88: | Line 88: | ||
=== tobits === | === tobits === | ||
'''Definition:'''<br> | '''Definition:'''<br> | ||
− | bit.tobits(n) | + | bit.tobits(n) (HTTPLIB) |
<br><br> | <br><br> | ||
'''Description:''' <br> | '''Description:''' <br> | ||
Line 98: | Line 98: | ||
=== blogic_rshift === | === blogic_rshift === | ||
'''Definition:'''<br> | '''Definition:'''<br> | ||
− | bit.blogic_rshift(n, bits) | + | bit.blogic_rshift(n, bits) (HTTPLIB) |
<br><br> | <br><br> | ||
'''Description:''' <br> | '''Description:''' <br> |
Latest revision as of 19:26, 5 June 2008
Contents
Functions
band
Definition:
bit.band(w1,w2)
Description:
returns the bitwise and of the w's
Example:
print (bit.band (15, 3)) --> 3
bor
Definition:
bit.bor(w1,w2)
Description:
returns the bitwise or of the w's
Example:
print (bit.bor (13, 17)) --> 29
bnot
Definition:
bit.bnot(a)
Description:
returns the one's complement of a
Example:
print(bit.bnot(10)) --> 4294967285
bxor
Definition:
bit.bxor(w1,...)
Description:
returns the bitwise exclusive or of the w's
Example:
print (bit.xor (15, 1)) --> 14
brshift
Definition:
bit.rshift(a,b)
Description:
returns a shifted logically right b places
Example:
print (bit.brshift (-1024, 6)) --> 4294967285
bxor2
Definition:
(HTTPLIB)
Description:
Example:
print (bit.xor (15, 1)) --> 14
tonumb
Definition:
bit.tonumb(bit_tbl) (HTTPLIB)
Description:
convert a bit table into a number
Example:
blshift
Definition:
bit.lshift(a,b) (HTTPLIB)
Description:
returns a shifted left b places
Example:
print (bit.blshift (4, 6)) --> 256
tobits
Definition:
bit.tobits(n) (HTTPLIB)
Description:
convert n into a bit table(which is a 1/0 sequence), high bits first
Example:
blogic_rshift
Definition:
bit.blogic_rshift(n, bits) (HTTPLIB)
Description:
logic right shift(zero fill >>>)
Example:
print (bit.blogic_rshift (144, 1)) --> 72