/// <summary> /// This routine simply tests for robustness of the toString function. /// </summary> static void WriteRepeatedSqr(DD xdd) { if (xdd.GreaterOrEqualThan(DD.ValueOf(1))) { throw new ArgumentException("Argument must be < 1"); } int count = 0; while (xdd.ToDoubleValue() > 1e-300) { count++; double x = xdd.ToDoubleValue(); var xSqr = xdd.Sqr(); string s = xSqr.ToString(); // System.Console.WriteLine(count + ": " + s); var xSqr2 = DD.Parse(s); xdd = xSqr; } }
/** * This routine simply tests for robustness of the toString function. * * @param xdd */ static void WriteRepeatedSqr(DD xdd) { if (xdd.GreaterOrEqualThan(DD.ValueOf(1))) throw new ArgumentException("Argument must be < 1"); int count = 0; while (xdd.ToDoubleValue() > 1e-300) { count++; double x = xdd.ToDoubleValue(); DD xSqr = xdd.Sqr(); String s = xSqr.ToString(); Console.WriteLine(count + ": " + s); DD xSqr2 = DD.Parse(s); xdd = xSqr; } }