import java.util.Scanner; public class MyName { public static void main(String[] args) { Scanner input = new Scanner(System.in); System.out.println("abs==" + Math.abs(-1.1)); } } import java.util.Scanner; public class MyName { public static void main(String[] args) { Scanner input = new Scanner(System.in); System.out.println("ceil==" + Math.ceil(-1.1)); } } import java.util.Scanner; public class MyName { public static void main(String[] args) { Scanner input = new Scanner(System.in); System.out.println("ceil==" + Math.ceil(1.2)); } } import java.util.Scanner; public class MyName { public static void main(String[] args) { Scanner input = new Scanner(System.in); System.out.println("ceil==" + Math.ceil(1.5)); } } import java.util.Scanner; public class MyName { public static void main(String[] args) { Scanner input = new Scanner(System.in); System.out.println("ceil==" + Math.ceil(-1.9)); } } public class MyName { public static void main(String[] args) { System.out.println("floor==" + Math.floor(1.9)); } } public class MyName { public static void main(String[] args) { System.out.println("floor==" + Math.floor(-1.9)); } } public class MyName { public static void main(String[] args) { System.out.println("round==" + Math.round(1.1)); } } public class MyName { public static void main(String[] args) { System.out.println("round==" + Math.round(1.6)); } } public class MyName { public static void main(String[] args) { System.out.println("sqrt==" + Math.sqrt(9)); } } public class MyName { public static void main(String[] args) { System.out.println("sqrt==" + Math.sqrt(100)); } } public class MyName { public static void main(String[] args) { System.out.println("Power==" + Math.pow(3, 10)); System.out.println("Power==" + Math.pow(3, 4)); } } public class MyName { public static void main(String[] args) { System.out.println("random==" + Math.random());//0.0<=value<1.0. System.out.println("random==" + Math.random()); } } public class MyName { public static void main(String[] args) { double r = (Math.random() * ((10 - 1) + 1) + 1); // double r = (Math.random() * 11); System.out.println("random=" + r); } } import java.util.Random; public class MyName { public static void main(String[] args) { int r = (int) (Math.random() * ((10 - 1) + 1) + 1);// use type casting // double r = (Math.random() * 11); System.out.println("random=" + r); } } import java.util.Random; public class MyName { public static void main(String[] args) { int r = (int) (Math.random() * ((10 - 1) + 1) + 1);// use type casting // double r = (Math.random() * 11); System.out.println("random=" + r); } } public class MyName { public static void main(String[] args) { System.out.println("Max==" + Math.max(20, 30)); } } public class MyName { public static void main(String[] args) { System.out.println("Max==" + Math.max(20.5, 30)); } } public class MyName { public static void main(String[] args) { System.out.println("Max==" + Math.max(20.5, Math.max(30, 40))); } } import javax.swing.plaf.basic.BasicInternalFrameTitlePane.MaximizeAction; public class MyName { public static void main(String[] args) { System.out.println("Pow=" + Math.pow((Math.sqrt(100)), 2)); } }
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter