56.3k views
5 votes
Which of the following statements is true?

A)int expressions are always computed exactly; but float expressionscan suffer round-off error
B)float expressions are always computed exactly; but int expressionscan suffer round-off error
C)Both int and float expressions can suffer round-offerror
D)Both int and float expressions will always be computedexactly

User Carl Meyer
by
5.6k points

1 Answer

1 vote

Answer:

Option (A) int expressions are always computed exactly; but float expressions can suffer round-off error.

Step-by-step explanation:

Round - Off Error can be defined as the digital computers have limitations on denoting the decimal numbers, due to this the floating point numbers have to be rounded off or even it is represented exactly after the calculation on the numbers the resulting number has to be adjusted / rounded off according to the specified precision. The resulted number has to be rounded off back to the required precision, this leads to the round off errors in digital computers. As integers don't need to go through the rounding off in computers, the integer numbers don't have round off errors, only floating point numbers have round off errors. So, options (B) , (C) and (D) are false.

User Relevart
by
6.3k points