コード例 #1
0
ファイル: UnitTest1.cs プロジェクト: drminor/FractalStudio
        public void TestSplitDouble()
        {
            double      x           = double.Parse("12.012345678901234");
            DComponents dComponents = new DComponents(x);

            double splitMult = Math.Pow(2, 25) + 1.0;

            double temp = x * splitMult;

            double hi = temp - (temp - x);
            double lo = x - hi;

            string s1 = dComponents.ToBase2String(true);
            string s2 = new DComponents(hi).ToBase2String(true);
            string s3 = new DComponents(lo).ToBase2String(true);
        }
コード例 #2
0
ファイル: UnitTest1.cs プロジェクト: drminor/FractalStudio
        public void TestCreateFp()
        {
            double One256th  = 0.00390625;
            double One1024th = Math.Pow(2, -10);

            double t = 12;

            t += One256th;
            t += One1024th;

            Fp a = new Fp(t);

            a.ReportDigitsBin();

            double      tc  = a.GetDouble();
            DComponents dtc = new DComponents(tc);

            Debug.WriteLine($"The recombined value is {dtc.ToBase2String(false)}, (Decimal: {tc}).");
        }
コード例 #3
0
ファイル: UnitTest1.cs プロジェクト: drminor/FractalStudio
 public void TestDComponents()
 {
     DComponents t   = new DComponents(8);
     string      st1 = t.ToBase2String(true);
     string      st2 = t.ToBase2String(false);
 }