Floating-Point in .NET Part I: Concepts and Formats
Hits: 317
Description: Author Date Of Submission User Level Jeffrey Sax 04/18/2005 Intermediate
Source Code: Extreme.FloatingPoint1.zip 8Kb Introduction Here's a quick
quiz. What is printed when the following piece of code runs? We calculate
one divided by 103 in both single and double precision. We then multiply by
103 again, and compare the result to the value we started out with:
Console.WriteLine("((double)(1/103.0))*103 < 1 is ",
((double)(1/103.0))*103 < 1); Console.WriteLine("((float)(1/103.0F))*103