User Tools


Differences

This shows you the differences between two versions of the page.

Link to this comparison view

cl:functions:logbitp [2019/06/15 02:00]
cl:functions:logbitp [2019/08/17 15:00] (current)
Line 1: Line 1:
 +====== Function LOGBITP ======
 +
 +====Syntax====
 +  * **logbitp** //index integer// → //​generalized-boolean//​
 +
 +====Arguments and Values====
 +  * //index// - a non-negative //​[[CL:​Glossary:​integer]]//​.
 +  * //integer// - an //​[[CL:​Glossary:​integer]]//​.
 +  * //​generalized-boolean//​ - a //​[[CL:​Glossary:​generalized boolean]]//​.
 +
 +====Description====
 +**logbitp** is used to test the value of a particular bit in //​integer//,​ that is treated as if it were binary.
 +
 +The value of **logbitp** is //​[[CL:​Glossary:​true]]//​ if the bit in //integer// whose index is //index// (that is, its weight is ''​2^index''​) is a one-bit; otherwise it is //​[[CL:​Glossary:​false]]//​.
 +
 +Negative //​integers//​ are treated as if they were in two'​s-complement notation.
 +
 +====Examples==== ​
 +<​blockquote> ​
 +(logbitp 1 1) <​r>//​[[CL:​Glossary:​false]]//​ </r>
 +(logbitp 0 1) <​r>//​[[CL:​Glossary:​true]]//​ </r>
 +(logbitp 3 10) <​r>//​[[CL:​Glossary:​true]]//​ </r>
 +(logbitp 1000000 -1) <​r>//​[[CL:​Glossary:​true]]//​ </r>
 +(logbitp 2 6) <​r>//​[[CL:​Glossary:​true]]//​ </r>
 +(logbitp 0 6) <​r>//​[[CL:​Glossary:​false]]//​ </r>
 +</​blockquote>​
 +
 +====Side Effects====
 +None.
 +
 +====Affected By====
 +None.
 +
 +====Exceptional Situations====
 +Should signal an error of type type-error if //index// is not a non-negative //​[[CL:​Glossary:​integer]]//​. Should signal an error of type type-error if //integer// is not an //​[[CL:​Glossary:​integer]]//​.
 +
 +====See Also====
 +None.
 +
 +====Notes====
 +<​blockquote> ​
 +(logbitp //k// //n//) ≡ ([[CL:​Functions:​ldb-test]] ([[CL:​Functions:​byte]] 1 //k//) //​n//​) ​
 +</​blockquote>​
 +
 +\issue{ARGUMENTS-UNDERSPECIFIED:​SPECIFY}