Question

In: Computer Science

Explain the difference between truncation and rounding.How can one operation be made to perform the function...

Explain the difference between truncation and rounding.How can one operation be made to perform the function of the other?

Solutions

Expert Solution

Truncation: In this case, the remaining digits after the decimal is chopped off, thus for example 23.49 if chopped or truncated will be made to just 23.
Rounding: In this case, we have to round or made the given number to the closest number as mentioned or said so while rounding. Like if we have to round the decimal number 23.4589 to 2 decimal digits then it will be rounded to 23.46 as the digit after the 45 is 8 so 45 will be rounded to 46.

For rounding and truncation to work same, we need to round a number to the nearest integer and if the decimal digits after the decimal are less than 5. Then the truncation and rounding will work the same.
Like if want to round 23.45 to the nearest integer and truncate 23.45.
So both of them will make it 23.

That was a nice question to answer
Friend, If you have any doubts in understanding do let me know in the comment section. I will be happy to help you further.
Thanks


Related Solutions

explain the difference between the transient period, and the steady-state operation. with examples
explain the difference between the transient period, and the steady-state operation. with examples
If the value of semaphore is negative, ___? A. an increment operation can be perform on...
If the value of semaphore is negative, ___? A. an increment operation can be perform on it. B. a process is waiting forever. C. there will be no process waiting on that semaphore. D. a decrement can be perform on it. ((( ( can negative semaphore decreases in case of more waiting processes? Explain in details. )))
explain the difference between classification of expenses by nature and by function.
explain the difference between classification of expenses by nature and by function.
describe the basic operation and componets of laser. in particular, explain. a) difference between a neon...
describe the basic operation and componets of laser. in particular, explain. a) difference between a neon lamp and helium-neon laser, b) why population inversion is necessary requirement to achieve lasing c)why laser light is coherent, monochromatic, polarized, and collimated, d) the methods for obtaining ultrashort laser pulses. what limits the pulse duration?
3.1. Explain the difference between the short-run and the long-run production function. Cite one example of...
3.1. Explain the difference between the short-run and the long-run production function. Cite one example of this difference in a business situation. (6) 3.2. Explain the relationship between the law of diminishing returns and the three stages of production using a graph showing total, marginal and average product. (10)
Explain the difference between the actual definition of a Riemann Integral of function f on the...
Explain the difference between the actual definition of a Riemann Integral of function f on the interval [a,b] and the conclusion of the FTOC Part 2.(Fundamental Theorem of Calculus Part 2)
Explain the difference between the actual definition of a Riemann Integral of function f on the...
Explain the difference between the actual definition of a Riemann Integral of function f on the interval [a,b] and the conclusion of the FTOC Part 2.(Fundamental Theorem of Calculus Part 2)
Explain the difference between a set that is well defined and one that is not. Give...
Explain the difference between a set that is well defined and one that is not. Give an example of a well-defined set. Name and describe your well-defined set using roster form and set-builder notation. Give an example of at least 1 subset. NO HANDWRITING PLEASE.
What is the difference between function and relation? Explain by giving example. Find the domain and...
What is the difference between function and relation? Explain by giving example. Find the domain and range of these functions. the function that assigns to each pair of positive integers the first integer of the pair             b) the function that assigns to each positive integer its largest decimal digit c) the function that assigns to a bit string the number of ones minus the number of zeros in the string d) the function that assigns to each positive integer...
The human lungs can function satisfactorily up to a limit where the pressure difference between the...
The human lungs can function satisfactorily up to a limit where the pressure difference between the outside and inside of the lungs is 1/19 of an atmosphere. If a diver uses a snorkel for breathing, how far below the water can she swim? Assume the diver is in salt water whose density is 1044 kg/m3.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT