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
Memory and processor both have big impact on the performance of a pc. <br>•true <br>•false <br>​
meriva

Answer:

true

Explanation:

they really do

the memory saves

while the processor determine the speed of the computer .... The processor also determine the price is the pc as it is the brain of the computer

4 0
3 years ago
What is the address of the first SFR (I/O Register)​
amid [387]

Answer:

The Special Function Register (SFR) is the upper area of addressable memory, from address 0x80 to 0xFF.

Explanation:

The Special Function Register (SFR) is the upper area of addressable memory, from address 0x80 to 0xFF.

Reason -

A Special Function Register (or Special Purpose Register, or simply Special Register) is a register within a microprocessor, which controls or monitors various aspects of the microprocessor's function.

4 0
3 years ago
Learning how to use word processing and spreadsheets, and creating presentations are all considered __________ computer skills.
irina [24]

Answer: a i hope it help

Explanation:

4 0
3 years ago
Read 2 more answers
We discussed in class the differences between Ruby and a language like Java. Based on our discussions, when do you feel it would
EleoNora [17]

Answer:

Ruby

It’s not a secret that our company places a bet on this interpreted scripting language created by Yukihiro Matsumoto in the far 1995. A bunch of deep-rooted technologies like Smalltalk, Python, Perl, Ada, C++, and others had an impact on shaping Ruby’s syntax and features. As a result, we got a technology known for elegant and expressive coding, as well as increased flexibility and productivity of development. It means that engineers take pleasure in writing code with Ruby and are not restricted in their vision on how to execute one thing or another.

Java

Despite Railsware’s unhidden preference towards Matsumoto’s brainchild, Java is also a part of our team’s arsenal. For example, we leveraged it together with other technologies within the Philips Directlife project. That’s to say, we know both of them and are happy to use whichever language best suits the task at hand.

In a sign of numerous Java and Ruby differences to be described a bit later, there is one undisputed similarity – they were born in the same year. Nevertheless, since then, Java has come through 11 versions with Java SE 11 as the latest one (compared to the Ruby’s latest release of 2.6.0). The technologies that influenced the creation of Java include C++, Ada 83, Object Pascal and others.

The TIOBE index shows that this compiled programming language overcame C in ranking and holds the first position as of the end of 2018. Moreover, it is a primary technology for Android native app development, which by the way was recently enhanced with Kotlin. Another facet of Java is that it is also an ecosystem of tools including Java Development Kit (JDK) for writing/running/compiling Java code, Java Virtual Machine (JVM) for running software built with Java and JVM languages within the same infrastructure to some degree of interoperability (for example, Kotlin for expressiveness and conciseness, Scala for functional programming, etc.), and Java Runtime Environment (JRE) for running Java apps. The basic points why developers opt for this technology are its reliability, platform independence, and ease of use.

Explanation:

The readers of our blog have already had a chance to get to know the duel of Ruby vs. PHP, as well as the combat Python vs. Ruby vs. Node.js. Today, we have Java vs. Ruby in turn.

Traditionally, we’re going to look at both technologies from a product owner’s perspective, which means learning not only technical differences between the languages, but also their actual use across different projects. Here we go.

Warm-up

Before any competition, the contestants need to warm up. It also happens that this term is used by one of the wrestlers, Java, for the lazy class loading of Java Virtual Machine. So, let’s not step out of line and have the competitors spiffed up to the battle.

Ruby

It’s not a secret that our company places a bet on this interpreted scripting language created by Yukihiro Matsumoto in the far 1995. A bunch of deep-rooted technologies like Smalltalk, Python, Perl, Ada, C++, and others had an impact on shaping Ruby’s syntax and features. As a result, we got a technology known for elegant and expressive coding, as well as increased flexibility and productivity of development. It means that engineers take pleasure in writing code with Ruby and are not restricted in their vision on how to execute one thing or another.

At the same time, this technology cannot be called popular. According to the TIOBE index as of December 2018, it is ranked 17th. Nevertheless, the language is not dying and keep afloat with the 3.0 version expected to be released in 2020. To sum up, Ruby allows programmers to enjoy what they do and be productive at once by following the principle of least astonishment.

Ruby key features

Apart from comparing Ruby to Java, let’s take a look at some key things one should know about this gem of a language.

Open-source

Interpreted language

Multi-platform

Dynamic + duck typing

Has a smart garbage collector

Everything including methods, numbers and variable is an object

You can embed Ruby into HTML

High scalability

Applicable for writing CGIs, building web and intranet apps

Support of different GUI tools including OpenGL, Tcl/Tk, and GTK

Support of Sybase, Oracle, MySQL, and DB2 connection

4 0
4 years ago
When using NAND gate instead of NOR gate in SR flip-flop, Q and Q’ both become one when?
Anika [276]

Answer:

  S and R both are 0

Explanation:

A <em>0</em> at the input of a NAND gate causes its output to be <em>1</em>. There is no other logic between the output NAND gate and the S or R inputs, so both inputs 0 will make both outputs 1.

4 0
4 years ago
Other questions:
  • How many bits are in 1 tb? [hint: depending on the tool used to calculate this, you may need to use a trick to get the exact res
    6·1 answer
  • A ____ in Excel is like a notebook.
    8·1 answer
  • A university wants to install a client-server network. Which feature do you think is important for them as they set up the netwo
    8·1 answer
  • Create a file with a 20 lines of text and name it "lines.txt". Write a program to read this a file "lines.txt" and write the tex
    12·1 answer
  • What attack occurs when a domain pointer that links a domain name to a specific web server is changed by a threat actor?
    11·1 answer
  • You have been asked to create a Community leveraging Out-of-the-box login, logout, self-registration, and error pages. Would you
    5·1 answer
  • Give two advantages of representing integers in pure binary.
    5·1 answer
  • An administrator has just changed the IP address of an interface on an IOS device. What else must be done in order to apply thos
    5·2 answers
  • 1)What is Big Data?
    14·1 answer
  • One vulnerability that makes computers susceptible to walmare is:
    13·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!