Skip to content

Instantly share code, notes, and snippets.

@bchetty
Created May 23, 2013 22:59
Show Gist options
  • Save bchetty/5640150 to your computer and use it in GitHub Desktop.
Save bchetty/5640150 to your computer and use it in GitHub Desktop.
Googol Number
public class Googol {
public static void main(String[] args) {
long googol1 = (long) Math.pow(10,100);
System.out.println("Googol1 : " + googol1);
System.out.println("Max Value of Long : " + Long.MAX_VALUE);
BigDecimal googol2 = new BigDecimal(Math.pow(10,100) + "");
System.out.println("Googol2 : " + googol2);
BigDecimal bigDecimal = googol2.multiply(new BigDecimal(Math.PI + ""));
System.out.println("Googol Multiplied By PI : " + bigDecimal);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment