#include <binary.h>
Public Member Functions | |
bin () | |
Default constructor. | |
bin (const short value) | |
Set the binary object equal to value . Either "0" or "1". | |
bin (const bin &inbin) | |
void | operator= (const short &value) |
Assign a value. | |
void | operator= (const bin &inbin) |
Assign a value. | |
void | operator/= (const bin &inbin) |
OR. | |
void | operator|= (const bin &inbin) |
OR. | |
bin | operator/ (const bin &inbin) const |
OR. | |
bin | operator| (const bin &inbin) const |
OR. | |
void | operator+= (const bin &inbin) |
XOR. | |
void | operator^= (const bin &inbin) |
XOR. | |
bin | operator+ (const bin &inbin) const |
XOR. | |
bin | operator^ (const bin &inbin) const |
XOR. | |
void | operator-= (const bin &inbin) |
XOR. | |
bin | operator- (const bin &inbin) const |
XOR. | |
bin | operator- () const |
Dummy definition to be able to use vec<bin>. | |
void | operator *= (const bin &inbin) |
AND. | |
void | operator &= (const bin &inbin) |
AND. | |
bin | operator * (const bin &inbin) const |
AND. | |
bin | operator & (const bin &inbin) const |
AND. | |
bin | operator! (void) const |
NOT. | |
bin | operator~ (void) const |
NOT. | |
bool | operator== (const bin &inbin) const |
Check if equal. | |
bool | operator== (const int &inbin) const |
Check if equal. | |
bool | operator!= (const bin &inbin) const |
Check if not equal. | |
bool | operator!= (const int &inbin) const |
Check if not equal. | |
bool | operator< (const bin &inbin) const |
Less than (interpret the binary values {0,1} as integers). | |
bool | operator<= (const bin &inbin) const |
Less than equal (interpret the binary values {0,1} as integers). | |
bool | operator> (const bin &inbin) const |
Greater than (interpret the binary values {0,1} as integers). | |
bool | operator>= (const bin &inbin) const |
Greater than equal (interpret the binary values {0,1} as integers). | |
operator short () const | |
Convert bin to short . | |
operator int () const | |
Convert bin to int . | |
operator bool () const | |
Convert bin to bool . | |
operator float () const | |
Convert bin to float . | |
operator double () const | |
Convert bin to double . | |
char | value () const |
Output the binary value of the object. | |
Related Functions | |
(Note that these are not member functions.) | |
ostream & | operator<< (ostream &output, const bin &inbin) |
Output stream of bin. | |
istream & | operator>> (istream &input, bin &outbin) |
Input stream of bin. |
Examples:
bin a; // Creation of variable bin a = 0; // Creating a variable and assigning it value 0 bin b = 1; // Creating a variable and assigning it value 1 bin c = a + b; // XOR operation c = !a; // NOT c = a * b; // AND c = a / b; // OR
|
Default constructor.
|
|
Set the binary object equal to
|
|
|
|
AND.
Here is the call graph for this function: |
|
AND.
|
|
AND.
Here is the call graph for this function: |
|
AND.
|
|
Convert
|
|
Convert
|
|
Convert
|
|
Convert
|
|
Convert
|
|
NOT.
Here is the call graph for this function: |
|
Check if not equal.
|
|
Check if not equal.
|
|
XOR.
Here is the call graph for this function: |
|
XOR.
|
|
Dummy definition to be able to use vec<bin>.
Here is the call graph for this function: |
|
XOR.
Here is the call graph for this function: |
|
XOR.
|
|
OR.
Here is the call graph for this function: |
|
OR.
|
|
Less than (interpret the binary values {0,1} as integers).
|
|
Less than equal (interpret the binary values {0,1} as integers).
|
|
Assign a value.
|
|
Assign a value.
|
|
Check if equal.
|
|
Check if equal.
|
|
Greater than (interpret the binary values {0,1} as integers).
|
|
Greater than equal (interpret the binary values {0,1} as integers).
|
|
XOR.
Here is the call graph for this function: |
|
XOR.
|
|
OR.
Here is the call graph for this function: |
|
OR.
|
|
NOT.
Here is the call graph for this function: |
|
Output the binary value of the object.
|
|
Output stream of bin.
|
|
Input stream of bin.
|