Created
August 2, 2016 16:35
-
-
Save nerzid/0f90c862ac1164f69bf12686f5b129c4 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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