Jak Visual Studio wyświetla System.Double podczas debugowania?

Spróbuj debugować następujący prosty program i najedź mysząx w każdym kroku (lub „Dodaj zegarek” dlax lub cokolwiek).

<code>using System;
using System.Globalization;

static class Program
{
  static double x;

  static void Main()
  {
    x = 2d;

    // now debugger shows "2.0", as if it has used
    // x.ToString("F1", CultureInfo.InvariantCulture)

    x = 8.0 / 7.0;

    // now debugger shows "1.1428571428571428", as if it had used
    // x.ToString("R", CultureInfo.InvariantCulture)
    // Note that 17 significant figures are shown, not the usual 15.

    x = -1e-200 / 1e200;

    // now debugger shows "0.0"; there is no indication that this is really negative zero
    //

    Console.WriteLine(1.0 / x); // this is negative infinity
  }
}
</code>

Najwyraźniej VS ma swój własny sposób wyświetlaniaSystem.Double. Jaka metoda wymaga tego do tego celu? Czy istnieje sposób, w jaki programowo mogę uzyskać taką samą reprezentację ciągu?

(Próbowałem tego z Visual Studio 2010 Professional.)

questionAnswers(2)

yourAnswerToTheQuestion