I am using Visual Studio 2015 with ASP.NET & C#. I have this calculation I am trying to implement into C# coding, but it says abs and min math functions are not there.
This is the code:
private double angle(int h, int m)
{
h = Convert.ToInt32(ddlHours.SelectedItem.Value);
m = Convert.ToInt32(ddlMinutes.SelectedItem.Value);
double hAngle = 0.5D * (h * 60 + m);
double mAngle = 6 * m;
double angle = Math.abs(hAngle - mAngle);
angle = Math.min(angle, 360 - angle);
return angle;
}
Ultimately, I want the answer to go to my label.
How do I get the abs and min function, or is there another way that still provides the accuracy of this calculation?