Please note, this is a STATIC archive of website www.tutorialspoint.com from 11 May 2019, cach3.com does not collect or store any user information, there is no "phishing" involved.
class Example {
static void main(String[] args) {
double x = 11.635;
double y = 2.76;
System.out.printf("The value of e is %.4f%n", Math.E);
System.out.printf("sqrt(%.3f) is %.3f%n", x, Math.sqrt(x));
}
}
class Example {
static void main(String[] args) {
double x = 11.635;
double y = 2.76;
System.out.printf("The value of e is %.4f%n", Math.E);
System.out.printf("pow(%.3f, %.3f) is %.3f%n", x, y, Math.pow(x, y));
}
}
class Example {
static void main(String[] args) {
double x = 11.635;
double y = 2.76;
System.out.printf("The value of e is %.4f%n", Math.E);
System.out.printf("log(%.3f) is %.3f%n", x, Math.log(x));
}
}
class Example {
static void main(String[] args) {
double x = 11.635;
double y = 2.76;
System.out.printf("The value of e is %.4f%n", Math.E);
System.out.printf("exp(%.3f) is %.3f%n", x, Math.exp(x));
}
}
class Example {
static void main(String[] args) {
double d = 100.675;
double e = 100.500;
float f = 100;
float g = 90f;
System.out.println(Math.round(d));
System.out.println(Math.round(e));
System.out.println(Math.round(f));
System.out.println(Math.round(g));
}
}
class Example {
static void main(String[] args){
double d = 100.675;
double e = 100.500;
double f = 100.200;
System.out.println(Math.rint(d));
System.out.println(Math.rint(e));
System.out.println(Math.rint(f));
}
}
class Example {
static void main(String[] args) {
double a = -100.675;
float b = -90;
System.out.println(Math.floor(a));
System.out.println(Math.floor(b));
}
}
class Example {
static void main(String[] args) {
double a = -100.675;
float b = -90;
System.out.println(Math.ceil(a));
System.out.println(Math.ceil(b));
}
}