
/** 
 Program: 	EssentialExpress Class
 Purpose: 	demonstrate Java math expressions;
 @author	john@december.com  
 @version	1.02; 22 July 1995
 */

class EssentialExpress{
   public static void main (String args[]) {

      double example;   // double precision is available for math

      //math operations are available:
      example = (3+2) + 5*3/7 + 3.123 + (42*7 + 4);
      System.out.println("example result = " + example);

      //common math functions are available:
      example = Math.sin(0.50) + Math.log(13) + Math.sqrt(2) + Math.exp(4);   
      System.out.println("example result = " + example);
				
      //other functions:
      System.out.println("absolute value of -3 = " + Math.abs(-3));
      System.out.println("a random number (0.0 to 1.0) = " + Math.random());
      System.out.println("round(3.65) = " + Math.round(3.65));
      System.out.println("2 to the third power (2*2*2) = " + Math.pow(2, 3));
      System.out.println("maximum of 3.98 and 14.2 = " + Math.max(3.98, 14.2));
   }
}
