c#: sum of two double numbers problem [duplicate]
问题 This question already has answers here : Closed 8 years ago . Possible Duplicate: Why is floating point arithmetic in C# imprecise? Hi. I've got following problem: 43.65+61.11=104.75999999999999 for decimal is correct: (decimal)43.65+(decimal)61.11=104.76 Why result for double is wrong? 回答1: This question and its answers are a wealth of info on this - Difference between decimal, float and double in .NET? To quote: For values which are "naturally exact decimals" it's good to use decimal. This