Adding functions to Standard Library
This commit is contained in:
parent
808d4ca420
commit
4a21ff3d46
39 changed files with 1465 additions and 51 deletions
|
@ -0,0 +1,33 @@
|
|||
namespace CSMic.StandardLibrary.Functions.Trigonometry.Hyperbolic
|
||||
{
|
||||
public class Cosh : FunctionBase, ICodedFunction
|
||||
{
|
||||
|
||||
public string Name
|
||||
{
|
||||
get
|
||||
{
|
||||
return "cosh";
|
||||
}
|
||||
}
|
||||
|
||||
public override IEnumerable<FunctionArgument> ExpectedArguments
|
||||
{
|
||||
get
|
||||
{
|
||||
yield return new FunctionArgument("value", FunctionValue.NUMBER);
|
||||
}
|
||||
}
|
||||
|
||||
public FunctionValue Execute(params FunctionArgument[] args)
|
||||
{
|
||||
return Execute(args, (_args) =>
|
||||
{
|
||||
var input = _args[0].Value;
|
||||
decimal value = Convert.ToDecimal(input.Value);
|
||||
|
||||
return new FunctionValue(FunctionValueType.Numeric, Math.Cosh((double)value));
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue