Advertisement
MrsMcLead

MathStuff

Feb 6th, 2014
301
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.60 KB | None | 0 0
  1. public class MathStuff
  2. {
  3.  public static void main(String[]args)
  4.  {
  5.    //square root
  6.    double a = Math.sqrt(25);
  7.    System.out.println(a);
  8.                      
  9.    //absolute value
  10.    int b = Math.abs(2);
  11.     System.out.println(b);
  12.    double c = Math.abs(-2.5);
  13.     System.out.println(c);
  14.    
  15.    
  16.    double d = Math.pow(4,-2);
  17.     System.out.println(d);
  18.    
  19.     long e = Math.round(2.44165641561);
  20.      System.out.println(e);
  21.      
  22.      int f = Math.max(5,6);
  23.       System.out.println(f);
  24.      
  25.       int g = Math.min(5,6);
  26.       System.out.println(g);
  27.      
  28.  }
  29.  
  30.  
  31.  
  32.  
  33. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement