1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
kap26 [50]
3 years ago
14

What method of the Math object can be used to return the largest value from the values that are passed to it?

Computers and Technology
1 answer:
miss Akunina [59]3 years ago
7 0

Answer:

the Math.max() method

Explanation:

The java.lang.* package contains all the essential components needed for a JAVA program which involves numbers and all the operations done on the numericals.

The java.lang.math class contains all the methods needed to perform mathematical operations on numerical values.

All the methods in the question are discussed below with examples.  

Math.max() method

java.lang.Math.max(double/ int/ float a, double/ int/ float b)

This method returns the highest value from among the parameters passed to it.

The syntax for the above is  

Numbers can be integers, float and double or long. The return type is the same as the parameters.

Two values to be compared are passed as arguments and the higher value of them is returned.

This function also accepts negative integers as parameters.

Math.max(-9, -2);

Gives -2 as the output.

Math.max(0.34, 0.45)

Gives 0.45 as the output.

Math.ceil() method

java.lang.Math.ceil(double/ int/ float a)  

This method returns the nearest greater whole number for the given number.

Integer parameter returns an integer number.

Math.ceil(7);

Gives 7 as the output.

Decimal number will return the nearest higher integer.

Math.ceil(8.7);

Gives 9.0 as the output.

Math.ceil(-0.34)

Gives -0 as the output.

Math.pow() method

java.lang.Math.pow(double/ float/ int a, double/ float/ int b)

The above method returns the result of a raise to the power of b.

The first parameter is the base while the second parameter forms the exponent.

Math.pow( 2.3,  4.5 );

This calculates (2.3)^4.5.

Gives 42.44‬ as the output.

Math.pow( 2, 3 );

This calculates the value of 2^3.

Gives 8 as the output.

Math.abs() method  

java.lang.Math.abs(double a)

This method returns non-negative value of the numerical parameter passed to it. Absolute of a number does not changes its value but changes the sign of a negative number. It returns the positive or negation of the negative input number.

Math.abs(-0.1234)

Gives 0.1234 as the output.

Math.abs(12.34)

Gives 12.34 as the output.

These methods require java.lang.Math to be imported in the program.

You might be interested in
What inventor patented the first american movie projector
kaheart [24]
Woodville Latham and his two sons, Otway and Grey demonstrated the first movie projector in the US 
8 0
3 years ago
Read 2 more answers
What is file management?can please help me​
ruslelena [56]
Is the process of administering a system that correctly handles digital data. also i think it improves the overall function of a business workflow. but this could be totally wrong.
6 0
3 years ago
Read 2 more answers
In theory, a(n) _____ can be an independent centralized database management system with proper interfaces to support remote acce
Vlad [161]

Answer:

Transaction Manger

Explanation:

Transaction Manger

Transaction Manager is responsible for transaction between resources that are available. It works as interface to support remote access form other systems in Data base management system.

8 0
2 years ago
Instagram
Aleonysh [2.5K]
Uninstall instagram and install it again. log in and go to settings and fix up the notifications maybe that’ll work??

if it doesn’t, go to your apple settings and see if the notifications for instagram are on.

also try shutting your phone off for a few seconds if you do either one.
5 0
3 years ago
In the Unified Process (UP), related activities are grouped into UP ____. a. Services b. Disciplines c. Cycles d. Practices
Paha777 [63]

Answer:

b. Disciplines

Explanation:

The Unified Process (UP) is a type of development framework that repeats itself and can be customized and used for several different variations of the same underlying process. In the Unified Process (UP), related activities are grouped into UP Disciplines, as one of the many components that make up the Unified Process.

6 0
3 years ago
Other questions:
  • What protocol must be supported by routers in order to utilize remote assistance easy connect?
    10·1 answer
  • If there are no differences between the amino acid sequences in the cytochrome c protein of humans and chimpanzees why aren't we
    15·1 answer
  • Downloading files is safe for most types of files except Select one: a. documents. b. pictures. c. executable files. d. music fi
    7·1 answer
  • MICR is an input or output devices
    5·1 answer
  • / Looks up author of selected books
    15·1 answer
  • Join zoom meet <br>id=547 458 9345<br>pw=sencHURI​
    8·2 answers
  • Liquid-liquid extraction is best suited to separate a mixture of compounds when:
    9·1 answer
  • Who Has any idea How to code?
    7·2 answers
  • How do you use switch board in the office​
    6·1 answer
  • What read a page on website​
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!