예제 #1
0
        public void TestCbrt(long x, long expected)
        {
            var result = BitConverter.DoubleToInt64Bits(MathEx.Cbrt(BitConverter.Int64BitsToDouble(x)));
            var delta  = Math.Abs(expected - result);

            if (delta > 1)
            {
                Assert.Fail($"result={result}, expected={expected}, delta={delta}");
            }
            else
            {
                Assert.IsTrue(true);
            }
        }