GUI: Update dd_real/float128
This commit is contained in:
parent
d379dd0023
commit
e0ec0c8f41
|
@ -948,6 +948,24 @@ dd_real::dd_real(std::wstring const & ws)
|
|||
}
|
||||
}
|
||||
|
||||
int dd_real::toInt() const
|
||||
{
|
||||
auto x = std::trunc(*this);
|
||||
return static_cast<int>(static_cast<long long>(x._hi()) + static_cast<long long>(x._lo()));
|
||||
}
|
||||
|
||||
long dd_real::toLong() const
|
||||
{
|
||||
auto x = std::trunc(*this);
|
||||
return static_cast<long>(static_cast<long long>(x._hi()) + static_cast<long long>(x._lo()));
|
||||
}
|
||||
|
||||
long long dd_real::toLongLong() const
|
||||
{
|
||||
auto x = std::trunc(*this);
|
||||
return static_cast<long long>(x._hi()) + static_cast<long long>(x._lo());
|
||||
}
|
||||
|
||||
dd_real dd_real::div(double a, double b)
|
||||
{
|
||||
if(QD_ISNAN(a))
|
||||
|
|
|
@ -435,37 +435,37 @@ public:
|
|||
dd_real(int h)
|
||||
{
|
||||
x[0] = static_cast<double>(h);
|
||||
x[1] = x[0] - h;
|
||||
x[1] = static_cast<double>(h - static_cast<int>(x[0]));
|
||||
}
|
||||
|
||||
dd_real(unsigned int h)
|
||||
{
|
||||
x[0] = static_cast<double>(h);
|
||||
x[1] = x[0] - h;
|
||||
x[1] = static_cast<double>(h - static_cast<unsigned int>(x[0]));
|
||||
}
|
||||
|
||||
dd_real(long h)
|
||||
{
|
||||
x[0] = static_cast<double>(h);
|
||||
x[1] = x[0] - h;
|
||||
x[1] = static_cast<double>(h - static_cast<long>(x[0]));
|
||||
}
|
||||
|
||||
dd_real(unsigned long h)
|
||||
{
|
||||
x[0] = static_cast<double>(h);
|
||||
x[1] = x[0] - h;
|
||||
x[1] = static_cast<double>(h - static_cast<unsigned long>(x[0]));
|
||||
}
|
||||
|
||||
dd_real(long long h)
|
||||
{
|
||||
x[0] = static_cast<double>(h);
|
||||
x[1] = x[0] - h;
|
||||
x[1] = static_cast<double>(h - static_cast<long long>(x[0]));
|
||||
}
|
||||
|
||||
dd_real(unsigned long long h)
|
||||
{
|
||||
x[0] = static_cast<double>(h);
|
||||
x[1] = x[0] - h;
|
||||
x[1] = static_cast<double>(h - static_cast<unsigned long long>(x[0]));
|
||||
}
|
||||
|
||||
dd_real(std::string const & s);
|
||||
|
@ -485,20 +485,9 @@ public:
|
|||
return _hi() + _lo();
|
||||
}
|
||||
|
||||
int toInt() const
|
||||
{
|
||||
return static_cast<int>(_hi()) + static_cast<int>(_lo());
|
||||
}
|
||||
|
||||
long toLong() const
|
||||
{
|
||||
return static_cast<long>(_hi()) + static_cast<long>(_lo());
|
||||
}
|
||||
|
||||
long long toLongLong() const
|
||||
{
|
||||
return static_cast<long long>(_hi()) + static_cast<long long>(_lo());
|
||||
}
|
||||
int toInt() const;
|
||||
long toLong() const;
|
||||
long long toLongLong() const;
|
||||
|
||||
dd_real const & operator+() const
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue