public string[] GetDigitsBin() { string[] result = new string[_digs.Length]; for (int i = 0; i < _digs.Length; i++) { result[i] = new DComponents(_digs[i]).ToBase2String(false); } return(result); }
public string[] GetDigValues() { string[] result = new string[POS_COUNT]; for (int i = 0; i < POS_COUNT; i++) { result[i] = new DComponents(_digs[i]).ToBase2String(false); } return(result); }
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])); }
public DComponents(DComponents dc) { IsNegative = dc.IsNegative; Exponent = dc.Exponent; Mantissa = dc.Mantissa; }