\\ Home Page : Articolo : Stampa
VS 2010 alters floating point number digits at random
Di Marco Tenuti (del 27/10/2014 @ 10:00:46, in .NET Framework, linkato 730 volte)

Just posted on MSDN Forum...

It's since three weeks that sometimes my local installation of Visual Studio .NET 2010 editor changes the source code lines adding several decimal digits when I recode the function or subroutine content (with the CTRL-K, CTRL-D shortcuts for example):


    yrif1 += 0.05 * _currentScale
    DrawScale(_currentScale, New Point2D(xrif1 + 0.2 * _currentScale, yrif1))


    yrif1 += 0.050000000000000003 * _currentScale
    DrawScale(_currentScale, New Point2D(xrif1 + 0.20000000000000001 * _currentScale, yrif1))

If I delete the less significant digits, the editor adds them again, when the cursors leaves the source code line. Do I need to uncheck Pretty listing (reformatting) of code in the Options > Text Editor > Basic > VB Specific panel? I would like to preserve such option, because it has always done a good job at reformatting the whole source code. I can't miss it.

It seems that behaviour started appearing in the last month, maybe some system patch. My system is a Windows 8.1 regular installation in Italian language and international settings are set as default.