¿Cómo visualiza Visual Studio un System.Double durante la depuración?
Intenta depurar el siguiente programa simple y pasa el mouse por encimax
en cada paso (o "Agregar reloj" parax
o lo que sea).
<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>
Entonces, aparentemente VS tiene su propia manera de mostrar unSystem.Double
. ¿Qué método requiere para este propósito? ¿Hay alguna manera de obtener la misma representación de cadena mediante programación?
(Intenté esto con Visual Studio 2010 Professional).