/*
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 { __extends } from "tslib";
import { BuiltInFunctionBase } from "./BuiltInFunctionBase";
import { ExcelCalcValue } from "./ExcelCalcValue";
import { markType } from "igniteui-angular-core";
import { CalcFunctionUtilities } from "./CalcFunctionUtilities";
import { ExcelCalcErrorValue } from "./ExcelCalcErrorValue";
import { truncate } from "igniteui-angular-core";
/**
 * @hidden
 */
var UltraCalcFunctionNominal = /** @class */ /*@__PURE__*/ (function (_super) {
    __extends(UltraCalcFunctionNominal, _super);
    function UltraCalcFunctionNominal() {
        return _super !== null && _super.apply(this, arguments) || this;
    }
    UltraCalcFunctionNominal.prototype.evaluate = function (a, b) {
        return CalcFunctionUtilities.j(a, false, function (c, d) {
            var e = truncate(d);
            var f = e;
            if (c <= 0 || f < 1) {
                return new ExcelCalcValue(new ExcelCalcErrorValue(4));
            }
            var g = (Math.pow(c + 1, 1 / f) - 1) * f;
            return new ExcelCalcValue(g);
        });
    };
    UltraCalcFunctionNominal.prototype.get_maxArgs = function () {
        return 2;
    };
    Object.defineProperty(UltraCalcFunctionNominal.prototype, "maxArgs", {
        get: function () {
            return this.get_maxArgs();
        },
        enumerable: false,
        configurable: true
    });
    UltraCalcFunctionNominal.prototype.get_minArgs = function () {
        return 2;
    };
    Object.defineProperty(UltraCalcFunctionNominal.prototype, "minArgs", {
        get: function () {
            return this.get_minArgs();
        },
        enumerable: false,
        configurable: true
    });
    UltraCalcFunctionNominal.prototype.get_name = function () {
        return "nominal";
    };
    Object.defineProperty(UltraCalcFunctionNominal.prototype, "name", {
        get: function () {
            return this.get_name();
        },
        enumerable: false,
        configurable: true
    });
    UltraCalcFunctionNominal.$t = markType(UltraCalcFunctionNominal, 'UltraCalcFunctionNominal', BuiltInFunctionBase.$);
    return UltraCalcFunctionNominal;
}(BuiltInFunctionBase));
export { UltraCalcFunctionNominal };
