make operator functions const
This commit is contained in:
12
utils.h
12
utils.h
@ -45,7 +45,7 @@ public:
|
||||
std::string to_str();
|
||||
BigFloat operator / (const BigFloat &f);
|
||||
|
||||
inline BigFloat operator - (const BigFloat &f)
|
||||
inline BigFloat operator - (const BigFloat &f) const
|
||||
{
|
||||
BigFloat res = BigFloat(f.precision);
|
||||
mpfr_sub(res.val, this->val, f.val, MPFR_RNDD);
|
||||
@ -53,7 +53,7 @@ public:
|
||||
return res;
|
||||
}
|
||||
|
||||
inline BigFloat operator - (const double d)
|
||||
inline BigFloat operator - (const double d) const
|
||||
{
|
||||
BigFloat res = BigFloat(this->precision);
|
||||
mpfr_sub_d(res.val, this->val, d, MPFR_RNDD);
|
||||
@ -61,7 +61,7 @@ public:
|
||||
return res;
|
||||
}
|
||||
|
||||
inline BigFloat operator * (const BigFloat &f)
|
||||
inline BigFloat operator * (const BigFloat &f) const
|
||||
{
|
||||
BigFloat res = BigFloat(f.precision);
|
||||
mpfr_mul(res.val, this->val, f.val, MPFR_RNDD);
|
||||
@ -69,7 +69,7 @@ public:
|
||||
return res;
|
||||
}
|
||||
|
||||
inline BigFloat operator * (const double d)
|
||||
inline BigFloat operator * (const double d) const
|
||||
{
|
||||
BigFloat res = BigFloat(this->precision);
|
||||
mpfr_mul_d(res.val, this->val, d, MPFR_RNDD);
|
||||
@ -77,7 +77,7 @@ public:
|
||||
return res;
|
||||
}
|
||||
|
||||
inline BigFloat operator + (const BigFloat &f)
|
||||
inline BigFloat operator + (const BigFloat &f) const
|
||||
{
|
||||
BigFloat res = BigFloat(f.precision);
|
||||
mpfr_add(res.val, this->val, f.val, MPFR_RNDD);
|
||||
@ -85,7 +85,7 @@ public:
|
||||
return res;
|
||||
}
|
||||
|
||||
inline BigFloat operator + (const double d)
|
||||
inline BigFloat operator + (const double d) const
|
||||
{
|
||||
BigFloat res = BigFloat(this->precision);
|
||||
mpfr_add_d(res.val, this->val, d, MPFR_RNDD);
|
||||
|
Reference in New Issue
Block a user