Possible Duplicates:
Why is (double)0.6f > (double)(6/10f)?
Why is floating point arithmetic in C# imprecise?
I have the following code in C#:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace StackOverflow
{
class Program
{
static void Main(string[] args)
{
float num1 = 17.03F;
float num2 = 17F;
float result = num1 - num2;
Console.WriteLine(result);
}
}
}
The code works fine but I am not getting the expected result. Can someone explain why this is happening?