Skip to content

Instantly share code, notes, and snippets.

@nerzid
Created August 2, 2016 16:35
Show Gist options
  • Save nerzid/0f90c862ac1164f69bf12686f5b129c4 to your computer and use it in GitHub Desktop.
Save nerzid/0f90c862ac1164f69bf12686f5b129c4 to your computer and use it in GitHub Desktop.
public class EulersNumber {
public static void main(String[] args) {
double euler = 1;
for (int i = 1; i < 100; i++) {
double fact = 1;
for(int j = i; j > 1; j--)
{
fact *= j;
}
euler += 1/fact;
}
System.out.println("euler: " + euler);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment