Skip to content

Instantly share code, notes, and snippets.

@azyobuzin
Created April 6, 2014 19:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save azyobuzin/10010717 to your computer and use it in GitHub Desktop.
Save azyobuzin/10010717 to your computer and use it in GitHub Desktop.
double Arctan(double x) {
double a = 0;
for (var i = 0; i < 10000; i++) {
var k = 1 + i *2;
if (i % 2 == 0) {
a = a + (1.0 / k * Math.Pow(x, k));
} else {
a = a - (1.0 / k * Math.Pow(x, k));
}
}
return a;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment