0% found this document useful (0 votes)
19 views8 pages

Java Math Library Functions Guide

The document provides an overview of the Java Math Library, detailing various mathematical functions such as Math.sqrt, Math.min, Math.max, and others, along with their purposes, return data types, and examples. It also includes exercises for users to practice using these functions and encourages them to explore differences between specific functions like Math.ceil and Math.floor. Additionally, it prompts users to write syntax for rounding numbers, calculating square roots, and finding the smaller of two numbers.

Uploaded by

k.anany1750
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
19 views8 pages

Java Math Library Functions Guide

The document provides an overview of the Java Math Library, detailing various mathematical functions such as Math.sqrt, Math.min, Math.max, and others, along with their purposes, return data types, and examples. It also includes exercises for users to practice using these functions and encourages them to explore differences between specific functions like Math.ceil and Math.floor. Additionally, it prompts users to write syntax for rounding numbers, calculating square roots, and finding the smaller of two numbers.

Uploaded by

k.anany1750
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 8

Mathematical

Library Methods
Topics to be covered
1. Recapitulation
2. Math Library
3. Functions used in Math Library
Package
• A package is a collection of classes. Every
Java package has a name and it can be
included within the program by using the
keyword import. These are used to perform
various tasks. [Link] is a method to
perform the calculations on String and
mathematical variables.
Mathematical Functions
Function Name Purpose Return data type Example
[Link](a) Returns the square double [Link](64) = 8.0
root of a positive
number.
[Link](a,b) Returns the smaller Depends upon the [Link](34,89) =
number between a input value 34
& b. [Link](-34,-89)
= -89
[Link](0.34,0.8
9) = 0.34
[Link](a,b) Returns the greater Depends upon the [Link](34,89) =
number between a input value 89
& b. [Link](-34,-89)
= -34
[Link](0.34,0.8
9) = 0.89
[Link](a,b) Returns the value a double [Link](5,3) =
b 125.0
[Link](a) Returns the value double
of natural
logarithm.
Mathematical Functions
Function Name Purpose Return data type Example
[Link](a) Returns the Depends upon the [Link](3.77) =
absolute value of input value 3.77
any numeral. [Link](-3.77) =
3.77
[Link](a) Returns the int [Link](2.75) =
rounded value up 3
to the nearest [Link](2.25) =
integer. 2
[Link](a) Returns the double [Link](2.75) =
rounded value 2.0
down to the [Link](-2.25) =
nearest integer. -2.0
[Link](a) Returns the whole double [Link] (2.75) =
number greater 3.0
than or equal to [Link](2.25) =
the number. 3.0
Let us think!
• Find the output.
1. [Link]([Link](5.0,-2.0));
2. [Link]([Link]([Link](-56.25)
);
3. [Link]([Link](8.5));
4. [Link]([Link](-8.50));?
5. [Link]([Link](-8.51));
6. [Link]([Link](-0.95));
7. [Link]([Link](-25.5,-12.5));
8. [Link]([Link](-0.88));
Write the answers in the notebook.
1. Distinguish between [Link]() and
[Link]()
2. Write syntax to find round off a number d,
square root of a number d and exponent of a
number e.
3. What is [Link](a) function used for? Give an
example.
4. What is the syntax to find smaller between two
numbers a and b?
YO U!
T H A N K

You might also like