C- Floating Point Issues MCQ Questions and Answers

Practice Mode
Showing 10 of 28 questions
Q21
Which technique helps reduce floating-point errors in summation operations?
  • A Bubble sort algorithm
  • B Kahan summation algorithm
  • C Binary search
  • D Quick sort algorithm
Answer: Option B
Explanation: Kahan summation uses compensation to track and correct lost low-order bits during addition.
Q22
What is the "unit in the last place" (ULP) error?
  • A Error in the first digit
  • B Spacing between floating-point numbers
  • C Memory allocation error
  • D Compiler optimization issue
Answer: Option B
Explanation: ULP measures the spacing between floating-point numbers, representing the worst-case rounding error.
Q23
Which of these values represents positive infinity in IEEE 754?
  • A 0
  • B 1
  • C Maximum finite value
  • D A special bit pattern
Answer: Option D
Explanation: Positive infinity is represented by a specific bit pattern with all exponent bits set to 1 and mantissa to 0.
Q24
What is "gradual underflow" in floating-point systems?
  • A Immediate zero assignment for small numbers
  • B Smooth transition using denormalized numbers
  • C Rounding all small numbers to nearest integer
  • D Using integers instead of floats
Answer: Option B
Explanation: Gradual underflow uses denormalized numbers to provide a smooth transition to zero.
Q25
Which operation is generally safe from catastrophic cancellation?
  • A a - b where a ≈ b
  • B a + b where a ≈ -b
  • C a * b where a ≈ b
  • D (a + b) - a where b is small
Answer: Option C
Explanation: Multiplication of numbers with similar magnitudes doesn't suffer from the same cancellation issues as subtraction.
Q26
What does the "sticky bit" help with in floating-point rounding?
  • A Detecting overflow
  • B Improving rounding accuracy
  • C Speeding up division
  • D Handling NaN values
Answer: Option B
Explanation: The sticky bit preserves information about trailing bits beyond what can be represented, improving rounding accuracy.
Q27
In floating-point comparison, why should direct equality checks be avoided?
  • A They are too slow
  • B They consume more memory
  • C Rounding errors make exact equality unlikely
  • D They cause compiler errors
Answer: Option C
Explanation: Direct equality fails due to accumulated rounding errors making exactly equal results unlikely.
Q28
What is the "hidden bit" in IEEE 754 normalized numbers?
  • A A bit that is always zero
  • B An implied leading 1 in mantissa
  • C The sign bit
  • D The least significant bit
Answer: Option B
Explanation: The hidden bit is an implied leading 1 in the mantissa that isn't stored explicitly, providing extra precision.
Questions and Answers for Competitive Exams Various Entrance Test