public static void ReportDigitsBin(double v, double[] digits) { DComponents vDc = new DComponents(v); Debug.WriteLine($"The value is {vDc.ToBase2String(false)} (Decimal: {FmtDouble(v)}."); for (int i = 0; i < digits.Length; i++) { DComponents dc = new DComponents(digits[i]); Debug.WriteLine($"The {i} val is {dc.ToBase2String(false)}."); } }
public void ReportDigitsBin() { double v = GetDouble(); DComponents vDc = new DComponents(v); Debug.WriteLine($"The value is {vDc.ToBase2String(false)} (Decimal: {FmtDouble(v)})."); Debug.WriteLine($"The decimal value is {ToDecimalString()}."); //string[] decComps = GetDecimalStrings(); //for (int i = 0; i < decComps.Length; i++) //{ // Debug.WriteLine($"The decComp for {i} val is {decComps[i]}."); //} string[] digs = GetDigitsBin(); for (int i = 0; i < digs.Length; i++) { Debug.WriteLine($"The {i} val is {digs[i]}, Decimal: {FmtDouble(_digs[i])}."); } }
public string GetDigitBin(int index) { DComponents dc = new DComponents(_digs[index]); return(dc.ToBase2String(false) + " Decimal: " + FmtDouble(_digs[index])); }