Skip to content
This repository has been archived by the owner on Feb 12, 2018. It is now read-only.

Commit

Permalink
Tan completed.
Browse files Browse the repository at this point in the history
  • Loading branch information
Paris committed Oct 23, 2010
1 parent dc48d10 commit b12c368
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 6 deletions.
2 changes: 1 addition & 1 deletion IronAHK/Site/docs/developing/status/index.html
Expand Up @@ -244,7 +244,7 @@
["SubStr", false, false, false, false, ""],
["Suspend", false, false, false, false, ""],
["SysGet", false, false, false, false, ""],
["Tan", false, false, false, false, ""],
["Tan", true, true, true, true, ""],
["Thread", false, false, false, false, ""],
["ToolTip", false, false, false, false, ""],
["Transform", false, false, false, false, ""],
Expand Down
10 changes: 5 additions & 5 deletions Rusty/Core/Math.cs
Expand Up @@ -238,13 +238,13 @@ public static double Sqrt(double n)
}

/// <summary>
/// Returns the trigonometric tangent of Number. Number must be expressed in radians.
/// Returns the tangent of the specified angle.
/// </summary>
/// <param name="Number"></param>
/// <returns></returns>
public static decimal Tan(decimal Number)
/// <param name="n">An angle, measured in radians.</param>
/// <returns>The tangent of <paramref name="n"/>.</returns>
public static double Tan(double n)
{
return (decimal)Math.Tan((double)Number);
return Math.Tan(n);
}
}
}
10 changes: 10 additions & 0 deletions Tests/Rusty/Math.cs
Expand Up @@ -198,5 +198,15 @@ public void Sqrt()

Assert.AreEqual(0, Core.Sqrt(-1));
}

[Test, Category("Math")]
public void Tan()
{
foreach (var n in new[] { -1, -0.5, 0, 0.5, 1, 0.675 })
{
var v = n * Math.PI;
Assert.AreEqual(Math.Tan(v), Core.Tan(v));
}
}
}
}

0 comments on commit b12c368

Please sign in to comment.