26 Oct
2024
26 Oct
'24
5:38 p.m.
Dear all ginac lovers, I have got some wrong results when performing some simple computations using ginac. I have compiled and run the following c++ program using ginac-1.8.7, cln-1.3.7 (mingw64 compiler, gcc version 14.2.0, windows 10 os), #include <ginac/ginac.h> using namespace std; using namespace GiNaC; int main() { cout<<(numeric(0.1)+numeric(7))<<endl; cout<<(numeric("0.01")*numeric("9"))<<endl; cout<<(numeric("0.01")*numeric("99"))<<endl; } the above program shows the following result: 7.1000000000000000056 0.089999999999999999996 0.98999999999999999995 I have got some unwanted digits which look very ugly. I think the result should be 7.1 0.09 0.99 Best regards, Mithun Bairagi