Order PDF of any content from our website with a little minor Fee to donate for hard work. Online MCQs are fully free but PDF books are paid. For details: contact whatsapp +923028700085 Important notes based PDF Books are available in very little price, starting from 500/-PKR; Order Now: contact whatsapp +923028700085

Past Papers CS101 – VU Computer Science Truncation Errors MCQ’s

Truncation Errors in Floating-Point Notation

Q#1: What is a truncation error in floating-point notation, and how does it occur?
Answer:

  • A truncation error occurs when precision is lost because a real number cannot be fully represented in the limited number of binary digits available in the mantissa.
  • Example: Storing 25⁄8 in a one-byte floating-point system results in truncation. Binary representation of 25⁄8 is 10.101, but the last 1 (1⁄8) may be discarded due to insufficient mantissa bits, causing a loss of information.

Q#2: How can truncation errors in floating-point notation be mitigated or reduced?
Answer:

  • Increase the size of the mantissa field (e.g., 32 bits) to allow more precise representation of fractional values.
  • Use a longer exponent field along with a longer mantissa.
  • This combination allows for greater precision and reduces truncation errors in floating-point computations.

Q#3: What is the difference between nonterminating expansions in binary and decimal notation, and how does this relate to truncation errors?
Answer:

  • Nonterminating expansions are numbers that cannot be expressed exactly with a finite number of digits in a base.
  • Binary notation has more nonterminating expansions than decimal. Example: 1/10 in decimal is nonterminating in binary.
  • This causes truncation errors when storing values like monetary amounts in floating-point notation.
  • Solution: Represent data in integer units (e.g., pennies) to avoid truncation errors, using integer representation methods like two’s complement.

Q#4: Explain how the order of adding small quantities affects the accuracy of their representation in floating-point notation.
Answer:

  • The order of addition affects accuracy due to truncation errors.
  • Best practice: Add smaller quantities first, then progressively add larger ones.
  • Example: Adding 1/8 + 1/8 = 1/4, then adding 2½ = 2¾, preserves accuracy.
  • Adding 2½ + 1/8 first may lose the precision of 1/8 due to truncation.
Contents Copyrights Reserved By T4Tutorials