28 lines
454 B
C++
28 lines
454 B
C++
#include "big_int.hpp"
|
|
#include <iostream>
|
|
|
|
tl::expected<BigInt,BigInt::eError>
|
|
BigInt::from_string(const std::string& str) {
|
|
BigInt b;
|
|
std::cout << str << std::endl;
|
|
b.data = str;
|
|
return b;
|
|
}
|
|
|
|
BigInt BigInt::from_int(uint64_t value)
|
|
{
|
|
BigInt b;
|
|
b.data = std::to_string(value);
|
|
return b;
|
|
}
|
|
|
|
std::string BigInt::to_string() const
|
|
{
|
|
return data;
|
|
}
|
|
|
|
bool operator == (const BigInt& rhs, const BigInt& lhs)
|
|
{ return rhs.data == lhs.data; }
|
|
|
|
|