Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bitwise operators and bitwise assignment operators #63

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 35 additions & 0 deletions include/BigInt.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,41 @@ class BigInt {
friend std::istream& operator>>(std::istream&, BigInt&);
friend std::ostream& operator<<(std::ostream&, const BigInt&);

// Bitwise operators:
BigInt operator<<(const BigInt&) const;
BigInt operator>>(const BigInt&) const;
BigInt operator|(const BigInt&) const;
BigInt operator&(const BigInt&) const;
BigInt operator^(const BigInt&) const;
BigInt operator<<(const long long&) const;
BigInt operator>>(const long long&) const;
BigInt operator|(const long long&) const;
BigInt operator&(const long long&) const;
BigInt operator^(const long long&) const;
BigInt operator<<(const std::string&) const;
BigInt operator>>(const std::string&) const;
BigInt operator|(const std::string&) const;
BigInt operator&(const std::string&) const;
BigInt operator^(const std::string&) const;
BigInt operator~() const;

//Bitwise assignment operators:
BigInt& operator<<=(const BigInt&);
BigInt& operator>>=(const BigInt&);
BigInt& operator|=(const BigInt&);
BigInt& operator&=(const BigInt&);
BigInt& operator^=(const BigInt&);
BigInt& operator<<=(const long long&);
BigInt& operator>>=(const long long&);
BigInt& operator|=(const long long&);
BigInt& operator&=(const long long&);
BigInt& operator^=(const long long&);
BigInt& operator<<=(const std::string&);
BigInt& operator>>=(const std::string&);
BigInt& operator|=(const std::string&);
BigInt& operator&=(const std::string&);
BigInt& operator^=(const std::string&);

// Conversion functions:
std::string to_string() const;
int to_int() const;
Expand Down
Loading