示例#1
0
        public void SpecialCasesTest()
        {
            float[]  floatData = { 0.0f, +Single.NaN, -Single.NaN, Single.MaxValue, Single.MinValue, Single.NegativeInfinity, Single.PositiveInfinity, };
            double[] doubleDataByStandardWay = ExactWay.CreateDoubleArray(floatData);
            double[] doubleDataByFastWay     = FastWay.CreateDoubleArray(floatData);

            Assert.That(doubleDataByFastWay, Is.EquivalentTo(doubleDataByStandardWay));
        }
示例#2
0
        public void SmallNumbers()
        {
            float[]  floatData = { 0.0f, 1, 1e-1f, 1e-2f, 1e-3f, 1e-4f, 1e-5f };
            double[] doubleDataByStandardWay = ExactWay.CreateDoubleArray(floatData);
            double[] doubleDataByFastWay     = FastWay.CreateDoubleArray(floatData);

            Assert.That(doubleDataByFastWay, Is.EquivalentTo(doubleDataByStandardWay));
        }
示例#3
0
        public void SanityTest()
        {
            Fixture fixture = new Fixture();

            float[]  floatData = fixture.CreateMany <float>(100).ToArray();
            double[] doubleDataByStandardWay = ExactWay.CreateDoubleArray(floatData);
            double[] doubleDataByFastWay     = FastWay.CreateDoubleArray(floatData);

            Assert.That(doubleDataByFastWay, Is.EquivalentTo(doubleDataByStandardWay));
        }