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
____ is the security guarantee that people who intercept messages cannot read them. A. Availability B. Encryption C. Confidentia
Anni [7]

Answer:

C. Confidentiality

Explanation:

With confidentiality, a person who intercepts messages you intend to remain private cannot read them and thus increases your document protection

8 0
2 years ago
What is the most useful advantage of social media in an emergency response effort?
gladu [14]
Being able to communicate directly with constituents.

ability to build situational awareness speed in which information can be delivered directly to the public
4 0
3 years ago
1.the following code example would print the data type of x, what data type would that be?
natta225 [31]

Answer:

x = 5, the data type is integer( integer data type is for whole numbers)

2. The data type is string

3. The data type is float (float data type is for decimals)

Explanation:

6 0
3 years ago
i was playing a mobile game and I was a guild leader in there. one of the members were very disrespectful and they just left bec
Sonbull [250]

Answer:

which mobile game? Whatever the worst thing you can do is. If its slurs and harassment or bullying report them

Explanation:

3 0
2 years ago
Read 2 more answers
What is a grant cycle?
Lina20 [59]

Answer:

The grant lifecycle refers to the entire process a grant goes through—from creating the opportunity through implementation and ending with the closeout.

Explanation:

... The grant lifecycle is comprised of three distinct phases: Pre-Award, Award, and Post Award. Hope that this helps you and have a great day :)

5 0
3 years ago
Read 2 more answers
Other questions:
  • Suppose you are using a Mac to read your e-mail messages, and you receive an
    8·2 answers
  • Match the technology with the appropriate task.
    7·1 answer
  • Text messaging is an example of nonverbal communication. Please select the best answer from the choices provided. T F
    7·2 answers
  • A technician receives an invalid certificate error when visiting a website with port 443 enabled. Other computers on the same LA
    8·1 answer
  • (BRAINLIEST QUESTION!!!)
    11·1 answer
  • Which type of network involves buildings in multiple cities connecting to each other?
    8·1 answer
  • If you often purchase items at the same e-tailer and do not have to type in your username and/or password, this probably means
    13·1 answer
  • Explain
    6·1 answer
  • Suppose that a 64MB system memory is built from 64 1MB RAM chips. How many address lines are needed to select one of the memory
    11·1 answer
  • In which program structure does the processor verify the mentioned condition only after executing the dependent statements once?
    8·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!