add invert support
This commit is contained in:
@@ -44,6 +44,8 @@ public:
|
||||
inline void Sub (HighPrecision const &o);
|
||||
inline void Mul (HighPrecision const &o);
|
||||
inline void Div (HighPrecision const &o);
|
||||
inline void MulByInvert (const HighPrecision &o);
|
||||
inline static HighPrecision Invert (uint64_t v);
|
||||
|
||||
inline int Compare (HighPrecision const &o) const;
|
||||
inline static HighPrecision Zero (void);
|
||||
@@ -101,6 +103,17 @@ HighPrecision::Div (HighPrecision const &o)
|
||||
{
|
||||
m_value /= o.m_value;
|
||||
}
|
||||
void
|
||||
HighPrecision::MulByInvert (const HighPrecision &o)
|
||||
{
|
||||
m_value *= o.m_value;
|
||||
}
|
||||
HighPrecision
|
||||
HighPrecision::Invert (uint64_t v)
|
||||
{
|
||||
return HighPrecision (1.0 / v);
|
||||
}
|
||||
|
||||
int
|
||||
HighPrecision::Compare (HighPrecision const &o) const
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user