Esempio n. 1
0
        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);
        }
Esempio n. 2
0
        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);
        }
Esempio n. 3
0
        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)}.");
            }
        }
Esempio n. 4
0
        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])}.");
            }
        }
Esempio n. 5
0
        public string GetDigitBin(int index)
        {
            DComponents dc = new DComponents(_digs[index]);

            return(dc.ToBase2String(false) + " Decimal: " + FmtDouble(_digs[index]));
        }
Esempio n. 6
0
 public DComponents(DComponents dc)
 {
     IsNegative = dc.IsNegative;
     Exponent   = dc.Exponent;
     Mantissa   = dc.Mantissa;
 }