-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathCalc.cs
More file actions
151 lines (133 loc) · 4.32 KB
/
Copy pathCalc.cs
File metadata and controls
151 lines (133 loc) · 4.32 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
using System.ComponentModel;
using Microsoft.SemanticKernel;
namespace Plugins;
public class CalcPlugin
{
[KernelFunction, Description("Add two numbers")]
public static double Add(
[Description("The first number to add")] double number1,
[Description("The second number to add")] double number2
)
{
return number1 + number2;
}
[KernelFunction, Description("Subtract one number from another number")]
public static double Subtract(
[Description("The first number to subtract from")] double number1,
[Description("The second number to subtract away")] double number2
)
{
return number1 - number2;
}
[KernelFunction, Description("Multiply two numbers.")]
public static double Multiply(
[Description("The first number to multiply")] double number1,
[Description("The second number to multiply")] double number2
)
{
return number1 * number2;
}
[KernelFunction, Description("Divide one number by another number")]
public static double Divide(
[Description("The first number to divide from")] double number1,
[Description("The second number to divide by")] double number2
)
{
return number1 / number2;
}
[KernelFunction, Description("Raise one number to the power of another number")]
public static double Power(
[Description("The number to be raised to a power")] double number1,
[Description("The power to raise the number by")] double number2
)
{
return Math.Pow(number1, number2);
}
[KernelFunction, Description("Take the nth root of a number")]
public static double Root(
[Description("The number of which to take the root")] double number1,
[Description("n")] double number2
)
{
return Math.Pow(number1, 1.0 / number2);
}
//[KernelFunction, Description("Take the log of a number")]
//public static double Log(
// [Description("The number to take the log of")] double number1,
// [Description("The base of the log")] double number2
//)
//{
// return Math.Log(number1, number2);
//}
//[KernelFunction, Description("Round a number to the target number of decimal places")]
//public static double Round(
// [Description("The number to round")] double number1,
// [Description("The number of decimal places to round to")] double number2
//)
//{
// return Math.Round(number1, (int)number2);
//}
//[KernelFunction, Description("Take the absolute value of a number")]
//public static double Abs(
// [Description("The number to take the absolute value of")] double number1
//)
//{
// return Math.Abs(number1);
//}
//[KernelFunction, Description("Take the floor of a number")]
//public static double Floor(
// [Description("The number to take the floor of")] double number1
//)
//{
// return Math.Floor(number1);
//}
//[KernelFunction, Description("Take the ceiling of a number")]
//public static double Ceiling(
// [Description("The number to take the ceiling of")] double number1
//)
//{
// return Math.Ceiling(number1);
//}
//[KernelFunction, Description("Take the sine of a number")]
//public static double Sin(
// [Description("The number to take the sine of")] double number1
//)
//{
// return Math.Sin(number1);
//}
//[KernelFunction, Description("Take the cosine of a number")]
//public static double Cos(
// [Description("The number to take the cosine of")] double number1
//)
//{
// return Math.Cos(number1);
//}
//[KernelFunction, Description("Take the tangent of a number")]
//public static double Tan(
// [Description("The number to take the tangent of")] double number1
//)
//{
// return Math.Tan(number1);
//}
//[KernelFunction, Description("Take the arcsine of a number")]
//public static double Asin(
// [Description("The number to take the arcsine of")] double number1
//)
//{
// return Math.Asin(number1);
//}
//[KernelFunction, Description("Take the arccosine of a number")]
//public static double Acos(
// [Description("The number to take the arccosine of")] double number1
//)
//{
// return Math.Acos(number1);
//}
//[KernelFunction, Description("Take the arctangent of a number")]
//public static double Atan(
// [Description("The number to take the arctangent of")] double number1
//)
//{
// return Math.Atan(number1);
//}
}