C#

Date: 2023-01-15 00:40 (UTC)
dennisgorelik: 2020-06-13 in my home office (0)
In C# floating point calculations are not precise too:
[TestMethod]
public void FloatingPointCheck()
{
	Assert.AreEqual(0.2, 0.1 + 0.1); // Passes
	Assert.AreEqual(3.0, 1.0 + 2.0); // Passes
	Assert.AreEqual(0.3, 0.1 + 0.2); // Fails
}
This account has disabled anonymous posting.
If you don't have an account you can create one now.
HTML doesn't work in the subject.
More info about formatting

If you are unable to use this captcha for any reason, please contact us by email at support@dreamwidth.org