Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Can't use bitwise operators on Infint #27

@dkdonkeykonng

Description

@dkdonkeykonng

Hi, I was wondering if there is anyway to use bitwise operators such as & or << and >> on the InfInt.
Here's my code:

#include "InfInt.h"
using namespace std;

int main() 
{
    InfInt num = "123456789012345678901234567890";
    int num2 = num & 1;
    cout << num2;
    return 0;
}

But I get this error: error C2676: binary '&': 'InfInt' does not define this operator or a conversion to a type acceptable to the predefined operator. I'm not sure if this is me or not, but it would really help if I could get them to work. Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions