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]
4 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]4 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
How can the font type of an existing style named No Spacing be changed?
sergejj [24]

Answer: it depends on the font size

Explanation:

8 0
3 years ago
Read 2 more answers
The 169.254.78.9 ip address is an example of what type of ip address
scoundrel [369]
As specified in RFC5735, this is an address from the "link local" block. It is assigned to a network interface as a temporary address, for instance if no static address is configured and the DHCP server is not found.

If you boot your PC without a network cable, you'll probably end up with a 169.254.*.* address.
8 0
3 years ago
What made the master so angry with his servant?​
sergeinik [125]

Answer:

what book?

Explanation:

6 0
3 years ago
Read 2 more answers
.What are signals, how can they be used?
goldfiish [28.3K]

Answer:

 The signal is the function which that carry information about the particular phenomenon in the signal processing. A signal is also define as the change in the quantity which is observable.

In terms of telecommunication, a signal is the varying current, voltage and the electromagnetic wave which basically carries data or information. Signal can be in the form of audio, image and radar related.

A signal can be used be various signal processing system and telecommunication fr the transmission of information from one device to another device.    

8 0
4 years ago
what is the difference between the registry and server manager in reference to its management/configuration ?
Ksivusya [100]

Explanation:

Server manager perform various types management tasks in Microsoft window to manage remote severs without require any physical access. It enable remote desktop connection protocols. It basically use server manager for manage the server remotely.

Registry is very important as it store essential information about the window system and about its configurations. It is mainly use in Microsoft window for operating its system and applications. It also store low level settings in the system.

6 0
3 years ago
Other questions:
  • Match the element of a presentation program to its description
    11·1 answer
  • Which magazine can help the public to determine the best technology to buy?
    14·1 answer
  • Which key must you press after you write into a cell?
    12·1 answer
  • In the cases of int, byte, long, short (In Java) Can you give the heirachy in ascending order?​
    6·1 answer
  • Which elements are in the Sort dialog box? Check all that apply.
    9·1 answer
  • Llllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll
    7·1 answer
  • Who creates Virus ? virus is not made for what?
    14·2 answers
  • Is(are) input value(s) to use with a program to test the accuracy of the output.
    5·2 answers
  • Write a menu-based program in C++ for an input restricted dequeue using Linked List consist of
    9·1 answer
  • What are your two biggest strengths as a student? How will these strengths help you become a self-directed learner?
    13·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!