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
The _____ unit is the preferred style unit for web page text because it makes it easy to develop pages in which different page e
cluponka [151]
Em The answer that you are looking for is (em)
6 0
3 years ago
Read 2 more answers
The smallest unit of a spreadsheet, and it is formed by the intersection of a row and a column.
slega [8]
The answer would be: B. Cell
5 0
3 years ago
You suspect that the Web Server, which is located on your network and hosts multiple Internet facing Websites. The Web Server ru
makkiz [27]

Answer:

Block all incoming ICMP requests.

Explanation:

Since  the  web  server  is  hosts  a  lot  of  internet  facing  websites .On investigation it was find out that the web server  is getting  flooded  with  a  lot of  ping  requests  hence  it  becomes unavailable  occasionally. So  to  tackle  this  problem  we  should  block  all  of  the  incoming  ICMP  requests.

5 0
3 years ago
The sides of a ladder are called
adoni [48]

I think they are called stringers or rails.

3 0
3 years ago
Read 2 more answers
A Java main method uses the parameter (String[ ] variable) so that a user can run the program and supply "command-line" paramete
xxTIMURxx [149]

Answer:

True

Explanation:

Java and some other object oriented programs makes use of the command line arguments. This enables one to pass additional information to a program when it is run. whatever information that is passed to the program at the command line argument will accompany the program when is it run and java stores this information as an array of strings.

4 0
3 years ago
Other questions:
  • The ____ function displays the highest value in a range.
    15·2 answers
  • A modern information-processing model that views memories as emerging from particular activation patterns within neural networks
    6·1 answer
  • What are the best 3 xbox 360 games ?​
    10·2 answers
  • A large population of ALOHA users manages to generate 50 requests/sec, including both originals and retransmissions. Time is slo
    5·1 answer
  • 1. What is wrong with the following code?
    5·1 answer
  • Can you withdraw from courses in top hat?
    14·1 answer
  • Some one help pls will mark brainless !!!!!
    13·1 answer
  • Why do people make Among Us games on Ro-blox, and thousands of people play them, when Among Us is free on all devises?
    10·1 answer
  • What is the purpose of a hyperlink in a presentation?
    11·1 answer
  • Another name of computer program is
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!