You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
> What steps will reproduce the problem?
I compiled
QDecDouble num("0.1");
QDecDouble aux = 1 + num;
cout << aux << endl;
and the result was
8.19999E-393
which is very close to zero, which is not adequate.
However, I compiled
double num(0.1);
double aux = 1 + num;
cout << aux << endl;
and the result was
1.1
which is correct. I obtained the same result using "qreal" instead of "double",
of course.
> What version of the product are you using? On what operating system?
QDecimal 1.0.1. Kubuntu 13.04.
Thanks for QDecimal!
Original issue reported on code.google.com by b3811...@uggsrock.com on 10 Aug 2013 at 5:48
The text was updated successfully, but these errors were encountered:
I also executed, with Gcc 4.7.3:
#include <decimal/decimal>
// [...]
typedef std::decimal::decimal64 dec64;
dec64 num(0.1dd);
dec64 aux = 1 + num;
dec64 onePointOne(1.1dd);
if (aux == onePointOne)
std::cout << "1.1" << std::endl;
else
std::cout << "ERROR." << std::endl;
and the result was
1.1
which is correct.
Original comment by b3811...@uggsrock.com on 11 Aug 2013 at 4:49
If it can be useful to anyone, I created a simple example that I attach. When
GCC 4.7.3 tries to compile it, instead of generating an unintended code, GCC
talks about an error ("no match for call to 'operator+’") and it does not
continue compiling.
Original comment by b3811...@uggsrock.com on 12 Aug 2013 at 10:44
Original issue reported on code.google.com by
b3811...@uggsrock.com
on 10 Aug 2013 at 5:48The text was updated successfully, but these errors were encountered: