public void SinhIntAndDoublesAsInputs() { var function = new Sinh(); var input1 = 20; var input2 = 100; var input3 = 1; var input4 = 1.0; var input5 = 1.5; var input6 = 1000; var result1 = function.Execute(FunctionsHelper.CreateArgs(input1), this.ParsingContext); var result2 = function.Execute(FunctionsHelper.CreateArgs(input2), this.ParsingContext); var result3 = function.Execute(FunctionsHelper.CreateArgs(input3), this.ParsingContext); var result4 = function.Execute(FunctionsHelper.CreateArgs(input4), this.ParsingContext); var result5 = function.Execute(FunctionsHelper.CreateArgs(input5), this.ParsingContext); var result6 = function.Execute(FunctionsHelper.CreateArgs(input6), this.ParsingContext); Assert.AreEqual(242582597.7, System.Math.Round(result1.ResultNumeric, 1)); Assert.AreEqual(1.3440585709080678E+43, System.Math.Round(result2.ResultNumeric, 9)); Assert.AreEqual(1.175201194, System.Math.Round(result3.ResultNumeric, 9)); Assert.AreEqual(1.175201194, System.Math.Round(result4.ResultNumeric, 9)); Assert.AreEqual(2.129279455, System.Math.Round(result5.ResultNumeric, 9)); Assert.AreEqual(eErrorType.Num, ((ExcelErrorValue)result6.Result).Type); }
public void SinhArsinh() { var exp = new Sinh(new Arsinh(new Variable("x"))); var expected = new Variable("x"); SimpleTest(exp, expected); }
public void SinhHandlesNormal12HourClockInputs() { var function = new Sinh(); var input1 = "00:00:00 AM"; var input2 = "00:01:32 AM"; var input3 = "12:00 PM"; var input4 = "12:00 AM"; var input5 = "1:00 PM"; var input6 = "1:10:32 am"; var input7 = "3:42:32 pm"; var result1 = function.Execute(FunctionsHelper.CreateArgs(input1), this.ParsingContext); var result2 = function.Execute(FunctionsHelper.CreateArgs(input2), this.ParsingContext); var result3 = function.Execute(FunctionsHelper.CreateArgs(input3), this.ParsingContext); var result4 = function.Execute(FunctionsHelper.CreateArgs(input4), this.ParsingContext); var result5 = function.Execute(FunctionsHelper.CreateArgs(input5), this.ParsingContext); var result6 = function.Execute(FunctionsHelper.CreateArgs(input6), this.ParsingContext); var result7 = function.Execute(FunctionsHelper.CreateArgs(input7), this.ParsingContext); Assert.AreEqual(0, result1.ResultNumeric, .00001); Assert.AreEqual(0.001064815, result2.ResultNumeric, .00001); Assert.AreEqual(0.521095305, result3.ResultNumeric, .00001); Assert.AreEqual(0, result4.ResultNumeric, .00001); Assert.AreEqual(0.568545722, result5.ResultNumeric, .00001); Assert.AreEqual(0.04900107, result6.ResultNumeric, .00001); Assert.AreEqual(0.702284427, result7.ResultNumeric, .00001); }
public void SinhTestInputsWithDatesThatHaveSlashesInThem() { var function = new Sinh(); var input1 = "1/17/2011 2:00 am"; var input2 = "17/01/2011 2:00 AM"; var input3 = "17/Jan/2011 2:00 AM"; var input4 = "17/January/2011 2:00 am"; var input5 = "1/17/2011 2:00:00 am"; var input6 = "17/01/2011 2:00:00 AM"; var input7 = "17/Jan/2011 2:00:00 AM"; var input8 = "17/January/2011 2:00:00 am"; var result1 = function.Execute(FunctionsHelper.CreateArgs(input1), this.ParsingContext); var result2 = function.Execute(FunctionsHelper.CreateArgs(input2), this.ParsingContext); var result3 = function.Execute(FunctionsHelper.CreateArgs(input3), this.ParsingContext); var result4 = function.Execute(FunctionsHelper.CreateArgs(input4), this.ParsingContext); var result5 = function.Execute(FunctionsHelper.CreateArgs(input5), this.ParsingContext); var result6 = function.Execute(FunctionsHelper.CreateArgs(input6), this.ParsingContext); var result7 = function.Execute(FunctionsHelper.CreateArgs(input7), this.ParsingContext); var result8 = function.Execute(FunctionsHelper.CreateArgs(input8), this.ParsingContext); Assert.AreEqual(eErrorType.Num, ((ExcelErrorValue)result1.Result).Type); Assert.AreEqual(eErrorType.Value, ((ExcelErrorValue)result2.Result).Type); Assert.AreEqual(eErrorType.Num, ((ExcelErrorValue)result3.Result).Type); Assert.AreEqual(eErrorType.Num, ((ExcelErrorValue)result4.Result).Type); Assert.AreEqual(eErrorType.Num, ((ExcelErrorValue)result5.Result).Type); Assert.AreEqual(eErrorType.Value, ((ExcelErrorValue)result6.Result).Type); Assert.AreEqual(eErrorType.Num, ((ExcelErrorValue)result7.Result).Type); Assert.AreEqual(eErrorType.Num, ((ExcelErrorValue)result8.Result).Type); }
public void CloneTest() { var exp = new Sinh(new Number(1)); var clone = exp.Clone(); Assert.Equal(exp, clone); }
public void SinhArsinh() { var exp = new Sinh(new Arsinh(Variable.X)); var expected = Variable.X; SimpleTest(exp, expected); }
public void SinhShouldReturnCorrectResult() { var func = new Sinh(); var args = FunctionsHelper.CreateArgs(2); var result = func.Execute(args, _parsingContext); var roundedResult = Math.Round((double)result.Result, 9); Assert.AreEqual(3.626860408d, roundedResult); }
public void SinhWithInvalidArgumentReturnsPoundValue() { var func = new Sinh(); var parsingContext = ParsingContext.Create(); var args = FunctionsHelper.CreateArgs(); var result = func.Execute(args, parsingContext); Assert.AreEqual(eErrorType.Value, ((ExcelErrorValue)result.Result).Type); }
public void ExecuteComplexNumberTest() { var complex = new Complex(3, 2); var exp = new Sinh(new ComplexNumber(complex)); var result = (Complex)exp.Execute(); Assert.Equal(Complex.Sinh(complex), result); Assert.Equal(-4.16890695996656435075, result.Real, 15); Assert.Equal(9.154499146911429573, result.Imaginary, 15); }
/// <summary> /// Analyzes the specified expression. /// </summary> /// <param name="exp">The expression.</param> /// <returns> /// The result of analysis. /// </returns> public override IExpression Analyze(Sinh exp) { if (!Helpers.HasVariable(exp, Variable)) { return(new Number(0)); } var cosh = new Cosh(exp.Argument.Clone()); var mul = new Mul(exp.Argument.Clone().Analyze(this), cosh); return(mul); }
public void SinhHandlesMilitaryTimesPast2400() { var function = new Sinh(); var input1 = "01:00"; var input2 = "02:00"; var result1 = function.Execute(FunctionsHelper.CreateArgs(input1), this.ParsingContext); var result2 = function.Execute(FunctionsHelper.CreateArgs(input2), this.ParsingContext); Assert.AreEqual(0.041678724, System.Math.Round(result1.ResultNumeric, 9)); Assert.AreEqual(0.083429817, System.Math.Round(result2.ResultNumeric, 9)); }
public void SinhHandlesInputDatesAreSeperatedByDashes() { var function = new Sinh(); var input1 = "1-17-2017 2:00"; var input2 = "1-17-2017 2:00 am"; var result1 = function.Execute(FunctionsHelper.CreateArgs(input1), this.ParsingContext); var result2 = function.Execute(FunctionsHelper.CreateArgs(input2), this.ParsingContext); Assert.AreEqual(eErrorType.Num, ((ExcelErrorValue)result1.Result).Type); Assert.AreEqual(eErrorType.Num, ((ExcelErrorValue)result2.Result).Type); }
public void SinhHandlesTrueOrFalse() { var function = new Sinh(); var input1 = true; var input2 = false; var result1 = function.Execute(FunctionsHelper.CreateArgs(input1), this.ParsingContext); var result2 = function.Execute(FunctionsHelper.CreateArgs(input2), this.ParsingContext); Assert.AreEqual(1.175201194, System.Math.Round(result1.ResultNumeric, 9)); Assert.AreEqual(0, System.Math.Round(result2.ResultNumeric, 9)); }
/// <summary> /// Analyzes the specified expression. /// </summary> /// <param name="exp">The expression.</param> /// <returns> /// The result of analysis. /// </returns> public override IExpression Analyze(Coth exp) { if (!Helpers.HasVariable(exp, Variable)) { return(new Number(0)); } var sinh = new Sinh(exp.Argument.Clone()); var inv = new Pow(sinh, new Number(2)); var div = new Div(exp.Argument.Clone().Analyze(this), inv); var unMinus = new UnaryMinus(div); return(unMinus); }
public void SinhHandlesMilitaryTime() { var function = new Sinh(); var input1 = "00:00"; var input2 = "00:01"; var input3 = "23:59:59"; var result1 = function.Execute(FunctionsHelper.CreateArgs(input1), this.ParsingContext); var result2 = function.Execute(FunctionsHelper.CreateArgs(input2), this.ParsingContext); var result3 = function.Execute(FunctionsHelper.CreateArgs(input3), this.ParsingContext); Assert.AreEqual(0, result1.ResultNumeric, .000001); Assert.AreEqual(0.000694445, System.Math.Round(result2.ResultNumeric, 9)); Assert.AreEqual(1.175183334, System.Math.Round(result3.ResultNumeric, 9)); }
public void SinhHandlesDateTimeInputs() { var function = new Sinh(); var input1 = "1/17/2011 2:00"; var input2 = "1/17/2011 2:00 AM"; var input3 = "17/1/2011 2:00 AM"; var input4 = "17/Jan/2011 2:00 AM"; var result1 = function.Execute(FunctionsHelper.CreateArgs(input1), this.ParsingContext); var result2 = function.Execute(FunctionsHelper.CreateArgs(input2), this.ParsingContext); var result3 = function.Execute(FunctionsHelper.CreateArgs(input3), this.ParsingContext); var result4 = function.Execute(FunctionsHelper.CreateArgs(input4), this.ParsingContext); Assert.AreEqual(eErrorType.Num, ((ExcelErrorValue)result1.Result).Type); Assert.AreEqual(eErrorType.Num, ((ExcelErrorValue)result2.Result).Type); Assert.AreEqual(eErrorType.Value, ((ExcelErrorValue)result3.Result).Type); Assert.AreEqual(eErrorType.Num, ((ExcelErrorValue)result4.Result).Type); }
public void SinhIsGivenAStringAsInput() { var function = new Sinh(); var input1 = "string"; var input2 = "0"; var input3 = "1"; var input4 = "1.5"; var result1 = function.Execute(FunctionsHelper.CreateArgs(input1), this.ParsingContext); var result2 = function.Execute(FunctionsHelper.CreateArgs(input2), this.ParsingContext); var result3 = function.Execute(FunctionsHelper.CreateArgs(input3), this.ParsingContext); var result4 = function.Execute(FunctionsHelper.CreateArgs(input4), this.ParsingContext); Assert.AreEqual(eErrorType.Value, ((ExcelErrorValue)result1.Result).Type); Assert.AreEqual(0, result2.ResultNumeric, .00001); Assert.AreEqual(1.175201194, result3.ResultNumeric, .00001); Assert.AreEqual(2.129279455, result4.ResultNumeric, .00001); }
public void SinhTestMilitaryTimeAndNormalTimeComparisions() { var function = new Sinh(); var input1 = "16:30"; var input2 = "04:30 pm"; var input3 = "02:30"; var input4 = "2:30 am"; var result1 = function.Execute(FunctionsHelper.CreateArgs(input1), this.ParsingContext); var result2 = function.Execute(FunctionsHelper.CreateArgs(input2), this.ParsingContext); var result3 = function.Execute(FunctionsHelper.CreateArgs(input3), this.ParsingContext); var result4 = function.Execute(FunctionsHelper.CreateArgs(input4), this.ParsingContext); Assert.AreEqual(0.742952946, System.Math.Round(result1.ResultNumeric, 9)); Assert.AreEqual(0.742952946, System.Math.Round(result2.ResultNumeric, 9)); Assert.AreEqual(0.104355149, System.Math.Round(result3.ResultNumeric, 9)); Assert.AreEqual(0.104355149, System.Math.Round(result4.ResultNumeric, 9)); }
public void SinhHandlesInputsWithDatesInTheFormMonthDateCommaYearTime() { var function = new Sinh(); var input1 = "Jan 17, 2011 2:00 am"; var input2 = "June 5, 2017 11:00 pm"; var input3 = "Jan 17, 2011 2:00:00 am"; var input4 = "June 5, 2017 11:00:00 pm"; var result1 = function.Execute(FunctionsHelper.CreateArgs(input1), this.ParsingContext); var result2 = function.Execute(FunctionsHelper.CreateArgs(input2), this.ParsingContext); var result3 = function.Execute(FunctionsHelper.CreateArgs(input3), this.ParsingContext); var result4 = function.Execute(FunctionsHelper.CreateArgs(input4), this.ParsingContext); Assert.AreEqual(eErrorType.Num, ((ExcelErrorValue)result1.Result).Type); Assert.AreEqual(eErrorType.Num, ((ExcelErrorValue)result2.Result).Type); Assert.AreEqual(eErrorType.Num, ((ExcelErrorValue)result3.Result).Type); Assert.AreEqual(eErrorType.Num, ((ExcelErrorValue)result4.Result).Type); }
public void SinhHandlesPi() { var function = new Sinh(); var Pi = System.Math.PI; var input1 = Pi; var input2 = Pi / 2; var input3 = 2 * Pi; var input4 = 60 * Pi / 180; var result1 = function.Execute(FunctionsHelper.CreateArgs(input1), this.ParsingContext); var result2 = function.Execute(FunctionsHelper.CreateArgs(input2), this.ParsingContext); var result3 = function.Execute(FunctionsHelper.CreateArgs(input3), this.ParsingContext); var result4 = function.Execute(FunctionsHelper.CreateArgs(input4), this.ParsingContext); Assert.AreEqual(11.54873936, System.Math.Round(result1.ResultNumeric, 8)); Assert.AreEqual(2.301298902, System.Math.Round(result2.ResultNumeric, 9)); Assert.AreEqual(267.744894, System.Math.Round(result3.ResultNumeric, 7)); Assert.AreEqual(1.249367051, System.Math.Round(result4.ResultNumeric, 9)); }
public void SinhIsGivenValuesRanginFromNegative10to10() { var function = new Sinh(); var input1 = -10; var input2 = -1; var input3 = 0; var input4 = 1; var input5 = 10; var result1 = function.Execute(FunctionsHelper.CreateArgs(input1), this.ParsingContext); var result2 = function.Execute(FunctionsHelper.CreateArgs(input2), this.ParsingContext); var result3 = function.Execute(FunctionsHelper.CreateArgs(input3), this.ParsingContext); var result4 = function.Execute(FunctionsHelper.CreateArgs(input4), this.ParsingContext); var result5 = function.Execute(FunctionsHelper.CreateArgs(input5), this.ParsingContext); Assert.AreEqual(-11013.23287, result1.ResultNumeric, .00001); Assert.AreEqual(-1.175201194, result2.ResultNumeric, .00001); Assert.AreEqual(0, result3.ResultNumeric, .00001); Assert.AreEqual(1.175201194, result4.ResultNumeric, .00001); Assert.AreEqual(11013.23287, result5.ResultNumeric, .00001); }
public void SinhHandlesDoublesCorrectly() { var function = new Sinh(); var input1 = 0.5; var input2 = 0.25; var input3 = 0.9; var input4 = -0.9; var input5 = ".5"; var result1 = function.Execute(FunctionsHelper.CreateArgs(input1), this.ParsingContext); var result2 = function.Execute(FunctionsHelper.CreateArgs(input2), this.ParsingContext); var result3 = function.Execute(FunctionsHelper.CreateArgs(input3), this.ParsingContext); var result4 = function.Execute(FunctionsHelper.CreateArgs(input4), this.ParsingContext); var result5 = function.Execute(FunctionsHelper.CreateArgs(input5), this.ParsingContext); Assert.AreEqual(0.521095305, System.Math.Round(result1.ResultNumeric, 9)); Assert.AreEqual(0.252612317, System.Math.Round(result2.ResultNumeric, 9)); Assert.AreEqual(1.026516726, System.Math.Round(result3.ResultNumeric, 9)); Assert.AreEqual(-1.026516726, System.Math.Round(result4.ResultNumeric, 9)); Assert.AreEqual(0.521095305, System.Math.Round(result5.ResultNumeric, 9)); }
/// <summary> /// Analyzes the specified expression. /// </summary> /// <param name="exp">The expression.</param> /// <returns> /// The result of analysis. /// </returns> /// <exception cref="System.NotSupportedException">Always.</exception> public virtual TResult Analyze(Sinh exp) { throw new NotSupportedException(); }
/// <summary> /// Analyzes the specified expression. /// </summary> /// <param name="exp">The expression.</param> /// <returns>The result of analysis.</returns> public string Analyze(Sinh exp) { return(ToString(exp, "sinh({0})")); }
/// <summary> /// Creates an expression object from <see cref="FunctionToken"/>. /// </summary> /// <param name="token">The function token.</param> /// <returns>An expression.</returns> protected virtual IExpression CreateFunction(FunctionToken token) { IExpression exp; switch (token.Function) { case Functions.Add: exp = new Add(); break; case Functions.Sub: exp = new Sub(); break; case Functions.Mul: exp = new Mul(); break; case Functions.Div: exp = new Div(); break; case Functions.Pow: exp = new Pow(); break; case Functions.Absolute: exp = new Abs(); break; case Functions.Sine: exp = new Sin(); break; case Functions.Cosine: exp = new Cos(); break; case Functions.Tangent: exp = new Tan(); break; case Functions.Cotangent: exp = new Cot(); break; case Functions.Secant: exp = new Sec(); break; case Functions.Cosecant: exp = new Csc(); break; case Functions.Arcsine: exp = new Arcsin(); break; case Functions.Arccosine: exp = new Arccos(); break; case Functions.Arctangent: exp = new Arctan(); break; case Functions.Arccotangent: exp = new Arccot(); break; case Functions.Arcsecant: exp = new Arcsec(); break; case Functions.Arccosecant: exp = new Arccsc(); break; case Functions.Sqrt: exp = new Sqrt(); break; case Functions.Root: exp = new Root(); break; case Functions.Ln: exp = new Ln(); break; case Functions.Lg: exp = new Lg(); break; case Functions.Lb: exp = new Lb(); break; case Functions.Log: exp = new Log(); break; case Functions.Sineh: exp = new Sinh(); break; case Functions.Cosineh: exp = new Cosh(); break; case Functions.Tangenth: exp = new Tanh(); break; case Functions.Cotangenth: exp = new Coth(); break; case Functions.Secanth: exp = new Sech(); break; case Functions.Cosecanth: exp = new Csch(); break; case Functions.Arsineh: exp = new Arsinh(); break; case Functions.Arcosineh: exp = new Arcosh(); break; case Functions.Artangenth: exp = new Artanh(); break; case Functions.Arcotangenth: exp = new Arcoth(); break; case Functions.Arsecanth: exp = new Arsech(); break; case Functions.Arcosecanth: exp = new Arcsch(); break; case Functions.Exp: exp = new Exp(); break; case Functions.GCD: exp = new GCD(); break; case Functions.LCM: exp = new LCM(); break; case Functions.Factorial: exp = new Fact(); break; case Functions.Sum: exp = new Sum(); break; case Functions.Product: exp = new Product(); break; case Functions.Round: exp = new Round(); break; case Functions.Floor: exp = new Floor(); break; case Functions.Ceil: exp = new Ceil(); break; case Functions.Derivative: exp = new Derivative(); break; case Functions.Simplify: exp = new Simplify(); break; case Functions.Del: exp = new Del(); break; case Functions.Define: exp = new Define(); break; case Functions.Vector: exp = new Vector(); break; case Functions.Matrix: exp = new Matrix(); break; case Functions.Transpose: exp = new Transpose(); break; case Functions.Determinant: exp = new Determinant(); break; case Functions.Inverse: exp = new Inverse(); break; case Functions.If: exp = new If(); break; case Functions.For: exp = new For(); break; case Functions.While: exp = new While(); break; case Functions.Undefine: exp = new Undefine(); break; case Functions.Im: exp = new Im(); break; case Functions.Re: exp = new Re(); break; case Functions.Phase: exp = new Phase(); break; case Functions.Conjugate: exp = new Conjugate(); break; case Functions.Reciprocal: exp = new Reciprocal(); break; case Functions.Min: exp = new Min(); break; case Functions.Max: exp = new Max(); break; case Functions.Avg: exp = new Avg(); break; case Functions.Count: exp = new Count(); break; case Functions.Var: exp = new Var(); break; case Functions.Varp: exp = new Varp(); break; case Functions.Stdev: exp = new Stdev(); break; case Functions.Stdevp: exp = new Stdevp(); break; default: exp = null; break; } if (exp is DifferentParametersExpression diff) { diff.ParametersCount = token.CountOfParams; } return(exp); }
public BuiltInFunctions() { // Text Functions["len"] = new Len(); Functions["lower"] = new Lower(); Functions["upper"] = new Upper(); Functions["left"] = new Left(); Functions["right"] = new Right(); Functions["mid"] = new Mid(); Functions["replace"] = new Replace(); Functions["rept"] = new Rept(); Functions["substitute"] = new Substitute(); Functions["concatenate"] = new Concatenate(); Functions["char"] = new CharFunction(); Functions["exact"] = new Exact(); Functions["find"] = new Find(); Functions["fixed"] = new Fixed(); Functions["proper"] = new Proper(); Functions["search"] = new Search(); Functions["text"] = new Text.Text(); Functions["t"] = new T(); Functions["hyperlink"] = new Hyperlink(); Functions["value"] = new Value(); // Numbers Functions["int"] = new CInt(); // Math Functions["abs"] = new Abs(); Functions["asin"] = new Asin(); Functions["asinh"] = new Asinh(); Functions["cos"] = new Cos(); Functions["cosh"] = new Cosh(); Functions["power"] = new Power(); Functions["sign"] = new Sign(); Functions["sqrt"] = new Sqrt(); Functions["sqrtpi"] = new SqrtPi(); Functions["pi"] = new Pi(); Functions["product"] = new Product(); Functions["ceiling"] = new Ceiling(); Functions["count"] = new Count(); Functions["counta"] = new CountA(); Functions["countblank"] = new CountBlank(); Functions["countif"] = new CountIf(); Functions["countifs"] = new CountIfs(); Functions["fact"] = new Fact(); Functions["floor"] = new Floor(); Functions["sin"] = new Sin(); Functions["sinh"] = new Sinh(); Functions["sum"] = new Sum(); Functions["sumif"] = new SumIf(); Functions["sumifs"] = new SumIfs(); Functions["sumproduct"] = new SumProduct(); Functions["sumsq"] = new Sumsq(); Functions["stdev"] = new Stdev(); Functions["stdevp"] = new StdevP(); Functions["stdev.s"] = new Stdev(); Functions["stdev.p"] = new StdevP(); Functions["subtotal"] = new Subtotal(); Functions["exp"] = new Exp(); Functions["log"] = new Log(); Functions["log10"] = new Log10(); Functions["ln"] = new Ln(); Functions["max"] = new Max(); Functions["maxa"] = new Maxa(); Functions["median"] = new Median(); Functions["min"] = new Min(); Functions["mina"] = new Mina(); Functions["mod"] = new Mod(); Functions["average"] = new Average(); Functions["averagea"] = new AverageA(); Functions["averageif"] = new AverageIf(); Functions["averageifs"] = new AverageIfs(); Functions["round"] = new Round(); Functions["rounddown"] = new Rounddown(); Functions["roundup"] = new Roundup(); Functions["rand"] = new Rand(); Functions["randbetween"] = new RandBetween(); Functions["rank"] = new Rank(); Functions["rank.eq"] = new Rank(); Functions["rank.avg"] = new Rank(true); Functions["quotient"] = new Quotient(); Functions["trunc"] = new Trunc(); Functions["tan"] = new Tan(); Functions["tanh"] = new Tanh(); Functions["atan"] = new Atan(); Functions["atan2"] = new Atan2(); Functions["atanh"] = new Atanh(); Functions["acos"] = new Acos(); Functions["acosh"] = new Acosh(); Functions["var"] = new Var(); Functions["varp"] = new VarP(); Functions["large"] = new Large(); Functions["small"] = new Small(); Functions["degrees"] = new Degrees(); // Information Functions["isblank"] = new IsBlank(); Functions["isnumber"] = new IsNumber(); Functions["istext"] = new IsText(); Functions["isnontext"] = new IsNonText(); Functions["iserror"] = new IsError(); Functions["iserr"] = new IsErr(); Functions["error.type"] = new ErrorType(); Functions["iseven"] = new IsEven(); Functions["isodd"] = new IsOdd(); Functions["islogical"] = new IsLogical(); Functions["isna"] = new IsNa(); Functions["na"] = new Na(); Functions["n"] = new N(); // Logical Functions["if"] = new If(); Functions["iferror"] = new IfError(); Functions["ifna"] = new IfNa(); Functions["not"] = new Not(); Functions["and"] = new And(); Functions["or"] = new Or(); Functions["true"] = new True(); Functions["false"] = new False(); // Reference and lookup Functions["address"] = new Address(); Functions["hlookup"] = new HLookup(); Functions["vlookup"] = new VLookup(); Functions["lookup"] = new Lookup(); Functions["match"] = new Match(); Functions["row"] = new Row(); Functions["rows"] = new Rows(); Functions["column"] = new Column(); Functions["columns"] = new Columns(); Functions["choose"] = new Choose(); Functions["index"] = new RefAndLookup.Index(); Functions["indirect"] = new Indirect(); Functions["offset"] = new Offset(); // Date Functions["date"] = new Date(); Functions["today"] = new Today(); Functions["now"] = new Now(); Functions["day"] = new Day(); Functions["month"] = new Month(); Functions["year"] = new Year(); Functions["time"] = new Time(); Functions["hour"] = new Hour(); Functions["minute"] = new Minute(); Functions["second"] = new Second(); Functions["weeknum"] = new Weeknum(); Functions["weekday"] = new Weekday(); Functions["days360"] = new Days360(); Functions["yearfrac"] = new Yearfrac(); Functions["edate"] = new Edate(); Functions["eomonth"] = new Eomonth(); Functions["isoweeknum"] = new IsoWeekNum(); Functions["workday"] = new Workday(); Functions["networkdays"] = new Networkdays(); Functions["networkdays.intl"] = new NetworkdaysIntl(); Functions["datevalue"] = new DateValue(); Functions["timevalue"] = new TimeValue(); // Database Functions["dget"] = new Dget(); Functions["dcount"] = new Dcount(); Functions["dcounta"] = new DcountA(); Functions["dmax"] = new Dmax(); Functions["dmin"] = new Dmin(); Functions["dsum"] = new Dsum(); Functions["daverage"] = new Daverage(); Functions["dvar"] = new Dvar(); Functions["dvarp"] = new Dvarp(); //Finance Functions["pmt"] = new Pmt(); }
public void SinhToStringTest() { var exp = new Sinh(new Number(5)); Assert.Equal("sinh(5)", exp.ToString(commoonFormatter)); }
public BuiltInFunctions() { // Text Functions["len"] = new Len(); Functions["lower"] = new Lower(); Functions["upper"] = new Upper(); Functions["left"] = new Left(); Functions["right"] = new Right(); Functions["mid"] = new Mid(); Functions["replace"] = new Replace(); Functions["rept"] = new Rept(); Functions["substitute"] = new Substitute(); Functions["concatenate"] = new Concatenate(); Functions["concat"] = new Concat(); Functions["textjoin"] = new Textjoin(); Functions["char"] = new CharFunction(); Functions["exact"] = new Exact(); Functions["find"] = new Find(); Functions["fixed"] = new Fixed(); Functions["proper"] = new Proper(); Functions["search"] = new Search(); Functions["text"] = new Text.Text(); Functions["t"] = new T(); Functions["hyperlink"] = new Hyperlink(); Functions["value"] = new Value(CultureInfo.CurrentCulture); Functions["trim"] = new Trim(); Functions["clean"] = new Clean(); Functions["unicode"] = new Unicode(); Functions["unichar"] = new Unichar(); Functions["numbervalue"] = new NumberValue(); Functions["dollar"] = new Dollar(); // Numbers Functions["int"] = new CInt(); // Math Functions["aggregate"] = new Aggregate(); Functions["abs"] = new Abs(); Functions["asin"] = new Asin(); Functions["asinh"] = new Asinh(); Functions["acot"] = new Acot(); Functions["acoth"] = new Acoth(); Functions["cos"] = new Cos(); Functions["cot"] = new Cot(); Functions["coth"] = new Coth(); Functions["cosh"] = new Cosh(); Functions["csc"] = new Csc(); Functions["csch"] = new Csch(); Functions["power"] = new Power(); Functions["gcd"] = new Gcd(); Functions["lcm"] = new Lcm(); Functions["sec"] = new Sec(); Functions["sech"] = new SecH(); Functions["sign"] = new Sign(); Functions["sqrt"] = new Sqrt(); Functions["sqrtpi"] = new SqrtPi(); Functions["pi"] = new Pi(); Functions["product"] = new Product(); Functions["ceiling"] = new Ceiling(); Functions["ceiling.precise"] = new CeilingPrecise(); Functions["ceiling.math"] = new CeilingMath(); Functions["iso.ceiling"] = new IsoCeiling(); Functions["combin"] = new Combin(); Functions["combina"] = new Combina(); Functions["permut"] = new Permut(); Functions["permutationa"] = new Permutationa(); Functions["count"] = new Count(); Functions["counta"] = new CountA(); Functions["countblank"] = new CountBlank(); Functions["countif"] = new CountIf(); Functions["countifs"] = new CountIfs(); Functions["fact"] = new Fact(); Functions["factdouble"] = new FactDouble(); Functions["floor"] = new Floor(); Functions["floor.precise"] = new FloorPrecise(); Functions["floor.math"] = new FloorMath(); Functions["radians"] = new Radians(); Functions["roman"] = new Roman(); Functions["sin"] = new Sin(); Functions["sinh"] = new Sinh(); Functions["sum"] = new Sum(); Functions["sumif"] = new SumIf(); Functions["sumifs"] = new SumIfs(); Functions["sumproduct"] = new SumProduct(); Functions["sumsq"] = new Sumsq(); Functions["sumxmy2"] = new Sumxmy2(); Functions["sumx2my2"] = new SumX2mY2(); Functions["sumx2py2"] = new SumX2pY2(); Functions["seriessum"] = new Seriessum(); Functions["stdev"] = new Stdev(); Functions["stdeva"] = new Stdeva(); Functions["stdevp"] = new StdevP(); Functions["stdevpa"] = new Stdevpa(); Functions["stdev.s"] = new StdevDotS(); Functions["stdev.p"] = new StdevDotP(); Functions["subtotal"] = new Subtotal(); Functions["exp"] = new Exp(); Functions["log"] = new Log(); Functions["log10"] = new Log10(); Functions["ln"] = new Ln(); Functions["max"] = new Max(); Functions["maxa"] = new Maxa(); Functions["median"] = new Median(); Functions["min"] = new Min(); Functions["mina"] = new Mina(); Functions["mod"] = new Mod(); Functions["mode"] = new Mode(); Functions["mode.sngl"] = new ModeSngl(); Functions["mround"] = new Mround(); Functions["multinomial"] = new Multinomial(); Functions["average"] = new Average(); Functions["averagea"] = new AverageA(); Functions["averageif"] = new AverageIf(); Functions["averageifs"] = new AverageIfs(); Functions["round"] = new Round(); Functions["rounddown"] = new Rounddown(); Functions["roundup"] = new Roundup(); Functions["rand"] = new Rand(); Functions["randbetween"] = new RandBetween(); Functions["rank"] = new Rank(); Functions["rank.eq"] = new RankEq(); Functions["rank.avg"] = new RankAvg(); Functions["percentile"] = new Percentile(); Functions["percentile.inc"] = new PercentileInc(); Functions["percentile.exc"] = new PercentileExc(); Functions["quartile"] = new Quartile(); Functions["quartile.inc"] = new QuartileInc(); Functions["quartile.exc"] = new QuartileExc(); Functions["percentrank"] = new Percentrank(); Functions["percentrank.inc"] = new PercentrankInc(); Functions["percentrank.exc"] = new PercentrankExc(); Functions["quotient"] = new Quotient(); Functions["trunc"] = new Trunc(); Functions["tan"] = new Tan(); Functions["tanh"] = new Tanh(); Functions["atan"] = new Atan(); Functions["atan2"] = new Atan2(); Functions["atanh"] = new Atanh(); Functions["acos"] = new Acos(); Functions["acosh"] = new Acosh(); Functions["covar"] = new Covar(); Functions["covariance.p"] = new CovarianceP(); Functions["covariance.s"] = new CovarianceS(); Functions["var"] = new Var(); Functions["vara"] = new Vara(); Functions["var.s"] = new VarDotS(); Functions["varp"] = new VarP(); Functions["varpa"] = new Varpa(); Functions["var.p"] = new VarDotP(); Functions["large"] = new Large(); Functions["small"] = new Small(); Functions["degrees"] = new Degrees(); Functions["odd"] = new Odd(); Functions["even"] = new Even(); // Information Functions["isblank"] = new IsBlank(); Functions["isnumber"] = new IsNumber(); Functions["istext"] = new IsText(); Functions["isnontext"] = new IsNonText(); Functions["iserror"] = new IsError(); Functions["iserr"] = new IsErr(); Functions["error.type"] = new ErrorType(); Functions["iseven"] = new IsEven(); Functions["isodd"] = new IsOdd(); Functions["islogical"] = new IsLogical(); Functions["isna"] = new IsNa(); Functions["na"] = new Na(); Functions["n"] = new N(); Functions["type"] = new TypeFunction(); // Logical Functions["if"] = new If(); Functions["ifs"] = new Ifs(); Functions["maxifs"] = new MaxIfs(); Functions["minifs"] = new MinIfs(); Functions["iferror"] = new IfError(); Functions["ifna"] = new IfNa(); Functions["not"] = new Not(); Functions["and"] = new And(); Functions["or"] = new Or(); Functions["true"] = new True(); Functions["false"] = new False(); Functions["switch"] = new Switch(); Functions["xor"] = new Xor(); // Reference and lookup Functions["address"] = new Address(); Functions["hlookup"] = new HLookup(); Functions["vlookup"] = new VLookup(); Functions["lookup"] = new Lookup(); Functions["match"] = new Match(); Functions["row"] = new Row(); Functions["rows"] = new Rows(); Functions["column"] = new Column(); Functions["columns"] = new Columns(); Functions["choose"] = new Choose(); Functions["index"] = new RefAndLookup.Index(); Functions["indirect"] = new Indirect(); Functions["offset"] = new Offset(); // Date Functions["date"] = new Date(); Functions["datedif"] = new DateDif(); Functions["today"] = new Today(); Functions["now"] = new Now(); Functions["day"] = new Day(); Functions["month"] = new Month(); Functions["year"] = new Year(); Functions["time"] = new Time(); Functions["hour"] = new Hour(); Functions["minute"] = new Minute(); Functions["second"] = new Second(); Functions["weeknum"] = new Weeknum(); Functions["weekday"] = new Weekday(); Functions["days"] = new Days(); Functions["days360"] = new Days360(); Functions["yearfrac"] = new Yearfrac(); Functions["edate"] = new Edate(); Functions["eomonth"] = new Eomonth(); Functions["isoweeknum"] = new IsoWeekNum(); Functions["workday"] = new Workday(); Functions["workday.intl"] = new WorkdayIntl(); Functions["networkdays"] = new Networkdays(); Functions["networkdays.intl"] = new NetworkdaysIntl(); Functions["datevalue"] = new DateValue(); Functions["timevalue"] = new TimeValue(); // Database Functions["dget"] = new Dget(); Functions["dcount"] = new Dcount(); Functions["dcounta"] = new DcountA(); Functions["dmax"] = new Dmax(); Functions["dmin"] = new Dmin(); Functions["dsum"] = new Dsum(); Functions["daverage"] = new Daverage(); Functions["dvar"] = new Dvar(); Functions["dvarp"] = new Dvarp(); //Finance Functions["cumipmt"] = new Cumipmt(); Functions["cumprinc"] = new Cumprinc(); Functions["dollarde"] = new DollarDe(); Functions["dollarfr"] = new DollarFr(); Functions["ddb"] = new Ddb(); Functions["effect"] = new Effect(); Functions["fvschedule"] = new FvSchedule(); Functions["pduration"] = new Pduration(); Functions["rri"] = new Rri(); Functions["pmt"] = new Pmt(); Functions["ppmt"] = new Ppmt(); Functions["ipmt"] = new Ipmt(); Functions["ispmt"] = new IsPmt(); Functions["pv"] = new Pv(); Functions["fv"] = new Fv(); Functions["npv"] = new Npv(); Functions["rate"] = new Rate(); Functions["nper"] = new Nper(); Functions["nominal"] = new Nominal(); Functions["irr"] = new Irr(); Functions["mirr"] = new Mirr(); Functions["xirr"] = new Xirr(); Functions["sln"] = new Sln(); Functions["syd"] = new Syd(); Functions["xnpv"] = new Xnpv(); Functions["coupdays"] = new Coupdays(); Functions["coupdaysnc"] = new Coupdaysnc(); Functions["coupdaybs"] = new Coupdaybs(); Functions["coupnum"] = new Coupnum(); Functions["coupncd"] = new Coupncd(); Functions["couppcd"] = new Couppcd(); Functions["price"] = new Price(); Functions["yield"] = new Yield(); Functions["yieldmat"] = new Yieldmat(); Functions["duration"] = new Duration(); Functions["disc"] = new Disc(); //Engineering Functions["bitand"] = new BitAnd(); Functions["bitor"] = new BitOr(); Functions["bitxor"] = new BitXor(); Functions["bitlshift"] = new BitLshift(); Functions["bitrshift"] = new BitRshift(); Functions["convert"] = new ConvertFunction(); Functions["bin2dec"] = new Bin2Dec(); Functions["bin2hex"] = new Bin2Hex(); Functions["bin2oct"] = new Bin2Oct(); Functions["dec2bin"] = new Dec2Bin(); Functions["dec2hex"] = new Dec2Hex(); Functions["dec2oct"] = new Dec2Oct(); Functions["hex2bin"] = new Hex2Bin(); Functions["hex2dec"] = new Hex2Dec(); Functions["hex2oct"] = new Hex2Oct(); Functions["oct2bin"] = new Oct2Bin(); Functions["oct2dec"] = new Oct2Dec(); Functions["oct2hex"] = new Oct2Hex(); Functions["delta"] = new Delta(); Functions["erf"] = new Erf(); Functions["erf.precise"] = new ErfPrecise(); Functions["erfc"] = new Erfc(); Functions["erfc.precise"] = new ErfcPrecise(); Functions["besseli"] = new BesselI(); Functions["besselj"] = new BesselJ(); Functions["besselk"] = new BesselK(); Functions["bessely"] = new BesselY(); }
public BuiltInFunctions() { // Text Functions["len"] = new Len(); Functions["lower"] = new Lower(); Functions["upper"] = new Upper(); Functions["left"] = new Left(); Functions["right"] = new Right(); Functions["mid"] = new Mid(); Functions["replace"] = new Replace(); Functions["substitute"] = new Substitute(); Functions["concatenate"] = new Concatenate(); Functions["exact"] = new Exact(); Functions["find"] = new Find(); Functions["proper"] = new Proper(); Functions["text"] = new Text.Text(); Functions["t"] = new T(); // Numbers Functions["int"] = new CInt(); // Math Functions["abs"] = new Abs(); Functions["cos"] = new Cos(); Functions["cosh"] = new Cosh(); Functions["power"] = new Power(); Functions["sign"] = new Sign(); Functions["sqrt"] = new Sqrt(); Functions["sqrtpi"] = new SqrtPi(); Functions["pi"] = new Pi(); Functions["product"] = new Product(); Functions["ceiling"] = new Ceiling(); Functions["count"] = new Count(); Functions["counta"] = new CountA(); Functions["countif"] = new CountIf(); Functions["fact"] = new Fact(); Functions["floor"] = new Floor(); Functions["sin"] = new Sin(); Functions["sinh"] = new Sinh(); Functions["sum"] = new Sum(); Functions["sumif"] = new SumIf(); Functions["sumproduct"] = new SumProduct(); Functions["sumsq"] = new Sumsq(); Functions["stdev"] = new Stdev(); Functions["stdevp"] = new StdevP(); Functions["stdev.s"] = new Stdev(); Functions["stdev.p"] = new StdevP(); Functions["subtotal"] = new Subtotal(); Functions["exp"] = new Exp(); Functions["log"] = new Log(); Functions["log10"] = new Log10(); Functions["ln"] = new Ln(); Functions["max"] = new Max(); Functions["maxa"] = new Maxa(); Functions["min"] = new Min(); Functions["mod"] = new Mod(); Functions["average"] = new Average(); Functions["averagea"] = new AverageA(); Functions["averageif"] = new AverageIf(); Functions["round"] = new Round(); Functions["rounddown"] = new Rounddown(); Functions["roundup"] = new Roundup(); Functions["rand"] = new Rand(); Functions["randbetween"] = new RandBetween(); Functions["quotient"] = new Quotient(); Functions["trunc"] = new Trunc(); Functions["tan"] = new Tan(); Functions["tanh"] = new Tanh(); Functions["atan"] = new Atan(); Functions["atan2"] = new Atan2(); Functions["var"] = new Var(); Functions["varp"] = new VarP(); // Information Functions["isblank"] = new IsBlank(); Functions["isnumber"] = new IsNumber(); Functions["istext"] = new IsText(); Functions["iserror"] = new IsError(); Functions["iserr"] = new IsErr(); Functions["iseven"] = new IsEven(); Functions["isodd"] = new IsOdd(); Functions["islogical"] = new IsLogical(); Functions["isna"] = new IsNa(); Functions["na"] = new Na(); Functions["n"] = new N(); // Logical Functions["if"] = new If(); Functions["not"] = new Not(); Functions["and"] = new And(); Functions["or"] = new Or(); Functions["true"] = new True(); // Reference and lookup Functions["address"] = new Address(); Functions["hlookup"] = new HLookup(); Functions["vlookup"] = new VLookup(); Functions["lookup"] = new Lookup(); Functions["match"] = new Match(); Functions["row"] = new Row(); Functions["rows"] = new Rows() { SkipArgumentEvaluation = true }; Functions["column"] = new Column(); Functions["columns"] = new Columns() { SkipArgumentEvaluation = true }; Functions["choose"] = new Choose(); Functions["index"] = new Index(); Functions["indirect"] = new Indirect(); // Date Functions["date"] = new Date(); Functions["today"] = new Today(); Functions["now"] = new Now(); Functions["day"] = new Day(); Functions["month"] = new Month(); Functions["year"] = new Year(); Functions["time"] = new Time(); Functions["hour"] = new Hour(); Functions["minute"] = new Minute(); Functions["second"] = new Second(); Functions["weeknum"] = new Weeknum(); Functions["weekday"] = new Weekday(); Functions["days360"] = new Days360(); Functions["yearfrac"] = new Yearfrac(); Functions["edate"] = new Edate(); Functions["eomonth"] = new Eomonth(); Functions["isoweeknum"] = new IsoWeekNum(); Functions["workday"] = new Workday(); }
public void ExecuteTestException() { var exp = new Sinh(new Bool(false)); Assert.Throws <ResultIsNotSupportedException>(() => exp.Execute()); }