boussaffawalid / muparserx

Automatically exported from code.google.com/p/muparserx
Other
0 stars 0 forks source link

long double problems #28

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Start latext example from sources
2. type in a+1
3. press ENTER

What is the expected output? What do you see instead?
3.22 is expected, 3.2200000000000000002 is what i got

Please use labels and text to provide additional information.
On Windows 7 + MinGW 4.7. Not tested in other compilers/oses.

Original issue reported on code.google.com by Rotter.M...@gmail.com on 23 Feb 2013 at 5:59

GoogleCodeExporter commented 9 years ago
Issue is not showing with Visual Studio compiler.

Original comment by Rotter.M...@gmail.com on 23 Feb 2013 at 6:02

GoogleCodeExporter commented 9 years ago
Sorry, the issue is invalid. Computers can not represent a floating point 
values with arbitrary precision. This is not a bug this is the way floating 
point numbers work. There is nothing that could or should be done about it as 
the problem is intrinsic to the very way floating point numbers are represented 
in a computer and there is absolutely no way i can fix a value beyond its 20'th 
digit if the datatype does not have the needed accuracy in the first place.

Original comment by ib...@gmx.info on 23 Feb 2013 at 10:01