answersLogoWhite

0


Best Answer

double round (double x) return (int) x + 0.5;

User Avatar

Wiki User

12y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: How does one write an algorithm that rounds off a decimal point to the nearest integer?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Continue Learning about Engineering

Java program using round function?

The following example rounds pi to an integer:System.out.println(Math.round(Math.PI));The following example rounds pi to an integer:System.out.println(Math.round(Math.PI));The following example rounds pi to an integer:System.out.println(Math.round(Math.PI));The following example rounds pi to an integer:System.out.println(Math.round(Math.PI));


Which parameters and design choices determine the actual algorithm of a Feistel cipher?

Block size: Larger block sizes mean greater security but reduced encryption/decryption speed. A block size of 64 bits is a reasonable tradeoff and has been nearly universal in block cipher design. However, the new AES uses a 128-bit block size.Key size: Larger key size means greater security but may decrease encryption/decryption speed. Key sizes of 64 bits or less are now widely considered being inadequate and 128 bits has become a common size.Number of rounds: The essence of the Feistel cipher is that a single round offers inadequate security but that multiple rounds offer increasing security. A typical size is 16 rounds.Sub key generation algorithm: Greater complexity in this algorithm should lead to greater difficulty of cryptanalysis.Round function: Again, greater complexity generally means greater resistance to cryptanalysis.


What is the explanation of sa 105?

It is an ASME Standard for Carbon stell forgings, rounds


What is the difference between MP2 and MP4?

MP2 and MP4 are two different gun types. MP2 guns can only shoot 2 rounds at a time, while MP4 can shoot 4 rounds at a time. MP6 and MP8 are higher round counts for larger and more powerful weapons.


What are API calls used for?

"API calls" have no specific question; the term APIsimply means application programming interface, and to call an API simply means to invoke a function (or subroutine) from a computer program.Each API call is different in how it is called (e.g. does it require any parameters, and of so, which), when (e.g. can it be called at any time and under all circumstances), what it does and what it returns to the caller.API functions serving closely related purposes are often grouped together into an API.Take this hypothetical example: One API provides services for rounding numbers: one function of this API rounds numbers to the nearest whole number, another function that belongs to the same API rounds numbers to the nearest hundredth.The purpose of API is unlimited. Examples of API include API to allocate, manage and return memory from a heap, API to create, manage and delete files and folders on a hard disk, API to get and set the current time, API to draw lines and other geometric shapes, etc, etc.

Related questions

What is 5.49 round decimal number to the nearest integer?

That rounds to 5.


How do you round 0.760?

It rounds to 0.8 to one decimal place or as 1 to the nearest whole number or integer


What is 4.4 rounded by 7.7 from greatest to least?

4.4 to the nearest integer rounds to 4. 7.7 to the nearest integer rounds to 8. 8 is greater than 4.


What does 1.5707 to the nearest percent rounds up to?

1.5707 = 157.07% which rounds up to 158%. To the nearest integer it would round DOWN to 157.It is 1.57


What is 5.49 rounded to number to the nearest integer?

That rounds to 5.


What is 2.08 to the nearest whole number?

It rounds off to 2 to the nearest whole number or integer


What is the square root of 17 rounded to the nearest integer?

4.123105626 rounds down to 4


What does 521 round to?

521 rounds to:1000 the nearest thousand500 to the nearest hundred520 to the nearest ten


How do you round a number to the nearest place value?

A decimal less than .5 rounds down to the nearest whole number. A decimal greater than .5 rounds up to the nearest whole number. A decimal of .5 depends on the country and application of use. In metric countries, like Canada, decimals of .5 are rounded to the nearest even number. For example: 1.4 rounds to 1 12.6 rounds to 13 5.5 rounds to 6 4.5 rounds to 4


How do you round the decimal notation 411 to the nearest tenth?

For 411 to be a decimal notation, it should have a decimal point. 0.411 rounds to 0.4 4.11 rounds to 4.1


What does 12.011 round to?

To the nearest whole number or integer it rounds to 12


What is the smallest tenths decimal number that rounds to 5 to nearest whole number?

It is: 4.5 rounds to 5