G
Guest
There appears to be a bug with Double, unless I'm missing something?
The following lines of code are basically all the same. However, some of the
numbers evaluate to "true" while others evaluate to "false". I can not figure
this out.
Response.Write((Convert.ToDouble("3.170404") == 3.170404)); // is true
Response.Write((Convert.ToDouble("5.170404") == 5.170404)); // why is this
false?
Response.Write((Convert.ToDouble("6.170404") == 6.170404)); // why is this
false?
Response.Write((Convert.ToDouble("8.170404") == 8.170404)); // is true
Any ideas? This occurs in both .NET 1.x and 2.x. Is this a bug or am I
missing something?
Regards,
Doug
The following lines of code are basically all the same. However, some of the
numbers evaluate to "true" while others evaluate to "false". I can not figure
this out.
Response.Write((Convert.ToDouble("3.170404") == 3.170404)); // is true
Response.Write((Convert.ToDouble("5.170404") == 5.170404)); // why is this
false?
Response.Write((Convert.ToDouble("6.170404") == 6.170404)); // why is this
false?
Response.Write((Convert.ToDouble("8.170404") == 8.170404)); // is true
Any ideas? This occurs in both .NET 1.x and 2.x. Is this a bug or am I
missing something?
Regards,
Doug