100% found this document useful (1 vote)
325 views24 pages

Java Math Functions and Syntax Guide

1) The document discusses various Java math package methods like Math.sqrt(), Math.min(), Math.max(), Math.pow(), Math.log(), Math.round(), Math.floor(), Math.ceil(), Math.sin(), Math.cos(), and Math.tan(). 2) It provides the purpose, return type, syntax and examples for each method. 3) Compound statements in Java allow multiple statements to be written within curly brackets.

Uploaded by

Soniya Babu
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
100% found this document useful (1 vote)
325 views24 pages

Java Math Functions and Syntax Guide

1) The document discusses various Java math package methods like Math.sqrt(), Math.min(), Math.max(), Math.pow(), Math.log(), Math.round(), Math.floor(), Math.ceil(), Math.sin(), Math.cos(), and Math.tan(). 2) It provides the purpose, return type, syntax and examples for each method. 3) Compound statements in Java allow multiple statements to be written within curly brackets.

Uploaded by

Soniya Babu
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd

General programming and decision

making in Java
Compound statements
Multiple statements that are written
within curly brackets are called
compound statements
Java packages
[Link]()
Find the square root of a positive
number
Returns double type value
Syntax
<return type> <variable> = function
name(positive number);
Example
double n = [Link](5);
Java packages
[Link]()
Find the minimum of two numbers
Returns type is according to the input

Syntax
<return type> <variable> = function
name(number1,number 2);
Example
double n = [Link](5,2);
Java packages
[Link]()
Find the maximum of two numbers
Returns type is according to the input

Syntax
<return type> <variable> = function
name(number1,number 2);
Example
double n = [Link](5,2);
Java packages
[Link]()
Find the power raised to a base
Returns double type value

Syntax
<return type> <variable> = function
name(number1,number 2);
Example
double n = [Link](5,2);
Java packages
[Link]()
Find the logarithmic value of a given
number
Returns double type value
Syntax
<return type> <variable> = function
name(positive number);
Example
double n = [Link](6.25);
Java packages
[Link]()
Returns the value in rounded form
Returns integer type always

Syntax
<return type> <variable> = function
name(positive number);
Example
double n = [Link](5.7);
Java packages
[Link]()
Returns a number down to the
nearest integer
Returns double type value always
Syntax
<return type> <variable> = function
name(positive number);
Example
double n = [Link](5.9);
Java packages
[Link]()
Returns rounded value to the next higher
integer
Returns double type value

Syntax
<return type> <variable> = function
name(positive number);
Example
double n = [Link](5.8);
Java packages
[Link]() , [Link](), [Link]()
Find the sin, cos and tan values
Returns double type value
Syntax
<return type> <variable> = function
name(positive number);
Example
double n = [Link](x);
double n = [Link](x);
double n = [Link](x);

You might also like