Changeset View
Changeset View
Standalone View
Standalone View
src/arith_uint256.h
Show All 17 Lines | |||||
class uint_error : public std::runtime_error { | class uint_error : public std::runtime_error { | ||||
public: | public: | ||||
explicit uint_error(const std::string &str) : std::runtime_error(str) {} | explicit uint_error(const std::string &str) : std::runtime_error(str) {} | ||||
}; | }; | ||||
/** Template base class for unsigned big integers. */ | /** Template base class for unsigned big integers. */ | ||||
template <unsigned int BITS> class base_uint { | template <unsigned int BITS> class base_uint { | ||||
protected: | protected: | ||||
enum { WIDTH = BITS / 32 }; | static constexpr int WIDTH = BITS / 32; | ||||
uint32_t pn[WIDTH]; | uint32_t pn[WIDTH]; | ||||
public: | public: | ||||
base_uint() { | base_uint() { | ||||
for (int i = 0; i < WIDTH; i++) | for (int i = 0; i < WIDTH; i++) | ||||
pn[i] = 0; | pn[i] = 0; | ||||
} | } | ||||
▲ Show 20 Lines • Show All 270 Lines • Show Last 20 Lines |