Question: Rounding is usually done by rounding up values that have a fractional part that is at least 0.5, and rounding down values that have a

Rounding is usually done by rounding up values that have a fractional part that is at least 0.5, and rounding down values that have a fractional part of less than 0.5. This means 14.55 is rounded to 15, while 2.3 is rounded to 2.

C/C++ does not have a rounding function. However, rounding can be achieved using the following math (the floor (Links to an external site.)Links to an external site. of x plus half):

Rounding is usually done by rounding up values that have a fractionalround(x)=x+12=2x+12

In the process of converting base-10 scientific notation to base-2 scientific notation, it not uncommon that we need to divide numbers by 10, and rounding can be integrated in the division:

part that is at least 0.5, and rounding down values that haveround(x10)=x10+12=x+510

The nice part is that integer division automatically truncates and for non-negative values, it is the same as taking the floor function.

Compute the difference between the rounded version and the truncated version of 10.18/10.

round(r 2 -1 - -1 2 round ( ) r+5 round(r 2 -1 - -1 2 round ( ) r+5

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!