/*
THIS INFRAGISTICS ULTIMATE SOFTWARE LICENSE  AGREEMENT ("AGREEMENT") LOCATED HERE:
https://www.infragistics.com/legal/license/igultimate-la
https://www.infragistics.com/legal/license/igultimate-eula
GOVERNS THE LICENSING, INSTALLATION AND USE OF INFRAGISTICS SOFTWARE. BY DOWNLOADING AND/OR INSTALLING AND USING INFRAGISTICS SOFTWARE:  you are indicating that you have read and understand this Agreement, and agree to be legally bound by it on behalf of the yourself and your company.
*/
import { BuiltInFunctionBase } from "./BuiltInFunctionBase";
import { ExcelCalcValue } from "./ExcelCalcValue";
import { ExcelCalcErrorValue } from "./ExcelCalcErrorValue";
import { markType } from "igniteui-angular-core";
/**
 * @hidden
 */
export let UltraCalcFunctionExponDist = /*@__PURE__*/ (() => {
    class UltraCalcFunctionExponDist extends BuiltInFunctionBase {
        evaluate(a, b) {
            let c = a.pop();
            let d = a.pop();
            let e = a.pop();
            if (e.isError) {
                return new ExcelCalcValue(e.toErrorValue());
            }
            if (d.isError) {
                return new ExcelCalcValue(d.toErrorValue());
            }
            if (c.isError) {
                return new ExcelCalcValue(c.toErrorValue());
            }
            let f = e._toDouble3();
            let g = d._toDouble3();
            let h = c._toBoolean1();
            if (f < 0 || g <= 0) {
                return new ExcelCalcValue(new ExcelCalcErrorValue(4));
            }
            let i = Math.exp(-f * g);
            let j = h ? 1 - i : g * i;
            return new ExcelCalcValue(j);
        }
        get_name() {
            return "expondist";
        }
        get name() {
            return this.get_name();
        }
        get_minArgs() {
            return 3;
        }
        get minArgs() {
            return this.get_minArgs();
        }
        get_maxArgs() {
            return 3;
        }
        get maxArgs() {
            return this.get_maxArgs();
        }
    }
    UltraCalcFunctionExponDist.$t = markType(UltraCalcFunctionExponDist, 'UltraCalcFunctionExponDist', BuiltInFunctionBase.$);
    return UltraCalcFunctionExponDist;
})();
