Are you building a financial/banking application? Because if you are,
it is better that you use the Decimal data type ("BigDecimal" in
Java)
to overcome a floating-point flaw found in the cpu itself
(http://en.wikipedia.org/wiki/Pentium_FDIV_bug).Regards Benj On Apr 17, 1:05 am, Bhargav Patel <[email protected]> wrote: > I have problem with Single dataType in .net , When I convet some > figure in .net in singe it returns unexpected results i.e. > > debug.Writeline(CSng (123342.15)) > > It Results > > 123342.148 > > Whats the logic behind it? > > For addition I found many figures that have unexpected results Like: > Csng(1233377.15) results- --> 1233377.13 > Csng(123342.14) results- --> 1123342.141 > > I thing if its rounding the result would be with less decimal places > but here its increasing decimal places. > > For more Information I also found same bug with decimal type. > > What should be reson for it? or Its bug with.Net I tried it in both > VB2005 and VB2008 but same results.
