C- Floating Point Issues MCQ Questions and Answers

Practice Mode
Showing 10 of 28 questions
Q11
What is the term for the error that occurs when a number cannot be represented exactly in floating-point format?
  • A Syntax error
  • B Rounding error
  • C Compilation error
  • D Logical error
Answer: Option B
Explanation: Rounding error occurs when a value is approximated to the nearest representable floating-point number.
Q12
In IEEE 754 single-precision floating-point, how many bits are allocated for the exponent?
  • A 11 bits
  • B 8 bits
  • C 23 bits
  • D 16 bits
Answer: Option B
Explanation: IEEE 754 single-precision uses 8 bits for exponent, 23 bits for mantissa, and 1 bit for sign.
Q13
Which of the following operations is most likely to amplify floating-point errors?
  • A Addition
  • B Multiplication
  • C Subtraction of nearly equal numbers
  • D Division by powers of 2
Answer: Option C
Explanation: Subtracting nearly equal numbers can lead to catastrophic cancellation and significant error amplification.
Q14
What is "catastrophic cancellation" in floating-point arithmetic?
  • A Division by zero
  • B Overflow beyond maximum value
  • C Loss of significant digits in subtraction
  • D Infinite loops in calculation
Answer: Option C
Explanation: Catastrophic cancellation occurs when significant digits are lost during subtraction of nearly equal numbers.
Q15
Which decimal value is most likely to cause representation issues in binary floating-point?
  • A 0.5
  • B 0.25
  • C 0.1
  • D 0.75
Answer: Option C
Explanation: 0.1 has a repeating binary representation, making it impossible to represent exactly in finite binary.
Q16
What is the purpose of the "guard digit" in floating-point operations?
  • A Prevent division by zero
  • B Detect overflow conditions
  • C Provide extra precision in intermediate calculations
  • D Speed up multiplication operations
Answer: Option C
Explanation: Guard digits provide extra precision during intermediate calculations to reduce rounding errors.
Q17
In IEEE 754 double-precision, how many bits are used for the mantissa?
  • A 23 bits
  • B 52 bits
  • C 11 bits
  • D 64 bits
Answer: Option B
Explanation: Double-precision uses 52 bits for mantissa, 11 bits for exponent, and 1 sign bit.
Q18
What is "denormalized numbers" in IEEE 754 standard?
  • A Numbers larger than maximum representable value
  • B Numbers with more precision than normal
  • C Numbers smaller than smallest normalized number
  • D Complex numbers with imaginary parts
Answer: Option C
Explanation: Denormalized numbers allow representation of values smaller than the smallest normalized number.
Q19
Which of these comparisons might give unexpected results due to floating-point precision?
  • A 1.5 == 1.5
  • B 0.1 + 0.2 == 0.3
  • C 2.0 == 2.0
  • D 0.0 == 0.0
Answer: Option B
Explanation: 0.1 + 0.2 != 0.3 due to cumulative representation errors of 0.1 and 0.2 in binary.
Q20
What is "NaN" in floating-point arithmetic?
  • A Not a Number
  • B Negative Absolute Number
  • C Normalized Arithmetic Value
  • D Negative Approximation Null
Answer: Option A
Explanation: NaN (Not a Number) represents undefined or unrepresentable results in floating-point calculations.
Questions and Answers for Competitive Exams Various Entrance Test