#ifndef BIG_INT_HPP #define BIG_INT_HPP #include "semi_bitset.hpp" template class BigInt{ private: int signum = 1; semi_bitset= 1000> bits; public: inline BigInt(){ } inline BigInt(int o){ if(o < 0){signum = -1;o *= -1;} bits.data[bits.length() - 1] = (unsigned int)o; } inline BigInt(unsigned int o){ bits.data[bits.length() - 1] = o; } inline BigInt(long long o){ if(o < 0){signum = -1;o *= -1;} bits.data[bits.length() - 1] = (lower_half); bits.data[bits.length() - 2] = (o >> 32); } inline BigInt(unsigned long long o){ bits.data[bits.length() - 1] = (o & lower_half); bits.data[bits.length() - 2] = (o >> 32); } template inline friend stream& operator<<(stream& s, const BigInt& o){ for(size_t i = 0;i < o.bits.length();i++) s << std::bitset<32>((uint32_t)(o.bits.data[i] & lower_half)); return s; } }; #endif