no need to bother with ignored return value
This commit is contained in:
@@ -19,7 +19,7 @@ HighPrecision::HighPrecision (double value)
|
||||
}
|
||||
#define MASK_LO ((((uint128_t)1)<<64)-1)
|
||||
#define MASK_HI (~MASK_LO)
|
||||
bool
|
||||
void
|
||||
HighPrecision::Mul (HighPrecision const &o)
|
||||
{
|
||||
bool negResult, negA, negB;
|
||||
@@ -62,9 +62,8 @@ HighPrecision::Mul (HighPrecision const &o)
|
||||
// add the sign to the result
|
||||
result = negResult ? -result:result;
|
||||
m_value = result;
|
||||
return true;
|
||||
}
|
||||
bool
|
||||
void
|
||||
HighPrecision::Div (HighPrecision const &o)
|
||||
{
|
||||
bool negResult, negA, negB;
|
||||
@@ -98,7 +97,6 @@ HighPrecision::Div (HighPrecision const &o)
|
||||
result = result + quo;
|
||||
result = negResult ? -result:result;
|
||||
m_value = result;
|
||||
return true;
|
||||
}
|
||||
|
||||
} // namespace ns3
|
||||
|
||||
@@ -39,10 +39,10 @@ public:
|
||||
|
||||
inline int64_t GetInteger (void) const;
|
||||
inline double GetDouble (void) const;
|
||||
inline bool Add (HighPrecision const &o);
|
||||
inline bool Sub (HighPrecision const &o);
|
||||
bool Mul (HighPrecision const &o);
|
||||
bool Div (HighPrecision const &o);
|
||||
inline void Add (HighPrecision const &o);
|
||||
inline void Sub (HighPrecision const &o);
|
||||
void Mul (HighPrecision const &o);
|
||||
void Div (HighPrecision const &o);
|
||||
|
||||
inline int Compare (HighPrecision const &o) const;
|
||||
inline static HighPrecision Zero (void);
|
||||
@@ -87,17 +87,15 @@ int64_t HighPrecision::GetInteger (void) const
|
||||
return v;
|
||||
}
|
||||
|
||||
bool
|
||||
void
|
||||
HighPrecision::Add (HighPrecision const &o)
|
||||
{
|
||||
m_value += o.m_value;
|
||||
return true;
|
||||
}
|
||||
bool
|
||||
void
|
||||
HighPrecision::Sub (HighPrecision const &o)
|
||||
{
|
||||
m_value -= o.m_value;
|
||||
return true;
|
||||
}
|
||||
|
||||
int
|
||||
|
||||
@@ -51,29 +51,25 @@ HighPrecision::GetDouble (void) const
|
||||
{
|
||||
return m_value;
|
||||
}
|
||||
bool
|
||||
void
|
||||
HighPrecision::Add (HighPrecision const &o)
|
||||
{
|
||||
m_value += o.m_value;
|
||||
return false;
|
||||
}
|
||||
bool
|
||||
void
|
||||
HighPrecision::Sub (HighPrecision const &o)
|
||||
{
|
||||
m_value -= o.m_value;
|
||||
return false;
|
||||
}
|
||||
bool
|
||||
void
|
||||
HighPrecision::Mul (HighPrecision const &o)
|
||||
{
|
||||
m_value *= o.m_value;
|
||||
return false;
|
||||
}
|
||||
bool
|
||||
void
|
||||
HighPrecision::Div (HighPrecision const &o)
|
||||
{
|
||||
m_value /= o.m_value;
|
||||
return false;
|
||||
}
|
||||
int
|
||||
HighPrecision::Compare (HighPrecision const &o) const
|
||||
@@ -86,4 +82,4 @@ HighPrecision::Zero (void)
|
||||
return HighPrecision (0,0);
|
||||
}
|
||||
|
||||
}; // namespace ns3
|
||||
} // namespace ns3
|
||||
|
||||
@@ -40,10 +40,10 @@ public:
|
||||
|
||||
int64_t GetInteger (void) const;
|
||||
double GetDouble (void) const;
|
||||
bool Add (HighPrecision const &o);
|
||||
bool Sub (HighPrecision const &o);
|
||||
bool Mul (HighPrecision const &o);
|
||||
bool Div (HighPrecision const &o);
|
||||
void Add (HighPrecision const &o);
|
||||
void Sub (HighPrecision const &o);
|
||||
void Mul (HighPrecision const &o);
|
||||
void Div (HighPrecision const &o);
|
||||
|
||||
int Compare (HighPrecision const &o) const;
|
||||
static HighPrecision Zero (void);
|
||||
@@ -52,6 +52,6 @@ private:
|
||||
double m_value;
|
||||
};
|
||||
|
||||
}; // namespace ns3
|
||||
} // namespace ns3
|
||||
|
||||
#endif /* HIGH_PRECISION_DOUBLE_H */
|
||||
|
||||
Reference in New Issue
Block a user