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