public void BetaInv()
 {
     Assert.That(ExcelFunctions.BetaInv(0.01, 2, 1.5), Is.EqualTo(0.07396024691).Within(1e-6), "A1");
     Assert.That(ExcelFunctions.BetaInv(0.25, 2, 1.5), Is.EqualTo(0.39447722186).Within(1e-6), "B1");
     Assert.That(ExcelFunctions.BetaInv(0.5, 2, 1.5), Is.EqualTo(0.58637250688).Within(1e-6), "C1");
     Assert.That(ExcelFunctions.BetaInv(0.75, 2, 1.5), Is.EqualTo(0.76115477285).Within(1e-6), "D1");
     Assert.That(ExcelFunctions.BetaInv(0.99, 2, 1.5), Is.EqualTo(0.97454166372).Within(1e-6), "E1");
     Assert.That(ExcelFunctions.BetaInv(0.9999, 2, 1.5), Is.EqualTo(0.99882984514).Within(1e-6), "F1");
 }
        private Operand F_BetaInv(List <Operand> arg)
        {
            CheckArgsCount("BETAINV", arg, new OperandType[][] {
                new OperandType[] { OperandType.NUMBER, OperandType.NUMBER, OperandType.NUMBER },
            });

            var probability = arg[0].NumberValue;
            var alpha       = arg[1].NumberValue;
            var beta        = arg[2].NumberValue;

            return(new Operand(OperandType.NUMBER, ExcelFunctions.BetaInv(probability, alpha, beta)));
        }
Beispiel #3
0
        private Operand BETAINV(List <Operand> arg)
        {
            //public static double BetaInv(double probability, double alpha, double beta)
            if (arg.Count < 3)
            {
                return(throwError("BETAINV中参数不足", new List <Operand>()));
            }
            var probability = arg[0].NumberValue;
            var alpha       = arg[1].NumberValue;
            var beta        = arg[2].NumberValue;

            return(new Operand(OperandType.NUMBER, ExcelFunctions.BetaInv(probability, alpha, beta)));
        }