Funny Comparison with Float
Brady Kelly <[email protected]> Thu, 6 Mar 2008 15:57:44 +0200
| Newsgroups | gmane.comp.windows.devel.dotnet.clr |
|---|---|
| Message-ID | <[email protected]> |
My colleague has just noticed a funny in comparing a float to a literal value. Where 'version' is a 'float', the expression "version == 1.1" evaluates to false, where the comparison "version == 1.1F" does. Last week's thread on floating point maths prompted me to raise the issue here to find out from the experts just what happens here. =================================== This list is hosted by DevelopMentorĀ® http://www.develop.com View archives and manage your subscription(s) at http://discuss.develop.com